无法从android中的facebook读取收件箱

时间:2014-05-29 01:39:24

标签: java android facebook api facebook-graph-api

我试图从Facebook上读取信息,以确定哪些是与我最相互影响的朋友。我为我的应用程序提供了以下读取权限:" user_friends"," user_groups"," user_interests"," read_mailbox"和" read_stream"。

这是我用来进行认证的代码

authButton = (LoginButton) findViewById(R.id.authButton);
authButton.setReadPermissions(Arrays.asList("user_friends","user_groups", "user_interests", "read_mailbox","read_stream"));

当登录过程完成后,我会重定向到另一个活动,我尝试读取我需要的数据

Request inboxRequest = new Request(Session.getActiveSession(), "me/inbox?limit=100", null, HttpMethod.GET, new Request.Callback() {
      @Override
      public void onCompleted(Response response) {
         if (response != null) {
         //My processing
         }
      }
});

当我运行我的应用程序时,我在响应中收到错误代码:

{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} 

我调试了我的代码,当我检查会话状态时,它有一个访问令牌值,但它已被删除,我不知道原因:

{Request:  session: {Session state:OPENED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[installed, public_profile, read_stream, read_mailbox, user_interests, user_groups, user_friends]}, appId:xxxxx}, graphPath: me/inbox?limit=100, graphObject: null, restMethod: null, httpMethod: GET, parameters: Bundle[{access_token=xxxx, format=json, sdk=android}]}

我将非常感谢有人帮我解决这个问题,我无法让它发挥作用

(对不起我的英文)

由于

0 个答案:

没有答案