2014-02-21 55 views
0
Session currentSession = Session.getActiveSession(); 
if (currentSession.isOpened()) { 

     Request req = new Request(currentSession, "/me/friends?fields=id,name,installed,picture",null, HttpMethod.GET, 
       new Callback() { 

      @Override 
      public void onCompleted(Response response) 
      { 
       //CODE.. 
      } 
     }); 
     Request.executeBatchAsync(req); 
} 

得到这样的回应。Android新的Facebook SDK例外图请求

{Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 2500, errorType: OAuthException, errorMessage: An active access token must be used to query information about the current user.}, isFromCache:false} 

这段代码有什么问题。

权限提供了 “publish_stream”, “user_likes”, “电子邮件”, “user_birthday”, “user_interests”, “user_friends”

回答

3

得到了result.Thanks @Jesse陈

Bundle params() = new Bundle(); 
params.putString("fields", "id,name,installed,picture"); 
Request req = new Request(session, "me/friends", params, HttpMethod.GET.. 
+0

对于我,这样做的错误已经消失。但是JSON中的数据是空的,而总而言之,它正确地返回了我的朋友的数量,但没有数据。任何建议? –

+0

@SwapnilPatil:你能解决这个问题吗?我仍然得到数据数组为空 –

+0

@Sunny:你能告诉我如何解决空阵列问题?使用这种格式时,我得到一个空数据数组。 –