从批量请求facebook graph api获取请求数据

时间:2015-09-21 20:04:16

标签: java android facebook facebook-graph-api

我有以下代码:

       GraphRequestBatch batch = new GraphRequestBatch(
                GraphRequest.newMeRequest(
                        AccessToken.getCurrentAccessToken(),
                        new GraphRequest.GraphJSONObjectCallback() {
                            @Override
                            public void onCompleted(
                                    JSONObject jsonObject,
                                    GraphResponse response) {
                                        Log.i(TAG, response.toString()); //Prints user information
                            }
                        }),
                GraphRequest.newGraphPathRequest(
                        AccessToken.getCurrentAccessToken(),
                        "me/taggable_friends",
                        new GraphRequest.Callback() {
                            @Override
                            public void onCompleted(
                                    GraphResponse graphResponse) {
                                Log.i(TAG, graphResponse.toString()); //Prints the taggable friends
                            }
                        })
        );
        batch.addCallback(new GraphRequestBatch.Callback() {
            @Override
            public void onBatchCompleted(GraphRequestBatch graphRequests) {
                // Application code for when the batch finishes

                //Get both friends and user information here?


            }
        });
        batch.executeAsync();

如何在onBatchCompleted内访问taggale朋友和用户信息? graphRequests不包含可标记的朋友和用户信息。

任何可以帮助我的人?​​

0 个答案:

没有答案