0

我在 android 中使用 Facebook SDK 3.5,当我尝试登录按钮时,出现我接受的权限消息,它只是返回登录屏幕

  authButton.setReadPermissions(Arrays.asList("basic_info","email"));
authButton.setSessionStatusCallback(new Session.StatusCallback() {

   @Override
   public void call(Session session, SessionState state, Exception exception) {

    if (session.isOpened()) {
              Log.i(TAG,"Access Token"+ session.getAccessToken());
              Request.executeMeRequestAsync(session,
                      new Request.GraphUserCallback() {
                          @Override
                          public void onCompleted(GraphUser user,Response response) {
                              if (user != null) { 
                               Log.i(TAG,"User ID "+ user.getId());
                               Log.i(TAG,"Email "+ user.asMap().get("email"));
                               lblEmail.setText(user.asMap().get("email").toString());
                              }
                          }
                      });} } });
 }

 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
     super.onActivityResult(requestCode, resultCode, data);
     Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
 }


}
4

0 回答 0