发送好友请求Android Facebook SDK

时间:2016-03-04 06:46:20

标签: android facebook facebook-graph-api sdk friendrequest

我环顾四周并尝试找到这个问题的解决方案,但似乎无法找到一个有效的解决方案,我正在尝试建立一个用户登录的界面,并将朋友请求发送给某个用户。我已经指定了facebook id。登录有效,但是当我尝试实现好友请求部分时,我看到的是一个对话框,显示您请求的页面不可用。

public class MainActivity extends Activity implements DialogListener {
    Facebook fb;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Set View that should be visible after log-in invisible initially
        // To maintain FB Login session
        TextView name = (TextView) findViewById(R.id.name);
        uiHelper = new UiLifecycleHelper(this, callback);
        uiHelper.onCreate(savedInstanceState);
    }

    // When session is changed, this method is called from callback method
    @SuppressWarnings("deprecation")
    private void onSessionStateChange(Session session, SessionState state,
            Exception exception) {
        // When Session is successfully opened (User logged-in)
        if (state.isOpened()) {
            Log.i(TAG, "Logged in...");
            fb = new Facebook("130211324324405");
            Bundle parameters = new Bundle();
            parameters.putString("id", "100001740420495");
            fb.dialog(this, "friends", parameters, this);
            // make request to the /me API to get Graph user
            Request.newMeRequest(session, new Request.GraphUserCallback() {

    }


}

0 个答案:

没有答案