Access Token Removed when posting facebook sdk 4.0 in Android

北战南征 提交于 2019-12-10 11:07:39

问题


By following the facebook sample for login and posting, after I do login and I get name and photo of my profile , when I try to post on wall in the following part..

if (accessToken != null) {
        pendingAction = action;
        if (hasPublishPermission()) 
{ handlePendingAction();

        } else
        {
                          LoginManager.getInstance().logInWithPublishPermissions(this,Arrays.asList(PERMISSION));
            return;
        }
    }

I get ACCESS_TOKEN_REMOVED permissions: [user_friends,public_profile,basic info] Why the permissions are removed if I successfully login. How can we fix it?


回答1:


Here are some general tips to help you debug this:

  • try to update to the latest SDK
  • try on different devices/emulators
  • try uninstalling the app and re-authorize from here

Now for permission specific issues, make sure to always test first with a user who's an Admin/Developer/Tester of an app, since your test will fail with normal user if you app is:

  • not public (still in development mode)
  • public BUT the permission you are testing against is not yet approved by Facebook



回答2:


Please be sure to override in your Activity the onActivityResult method:

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {

    super.onActivityResult(requestCode, resultCode, data);

    Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);

}


来源:https://stackoverflow.com/questions/29587671/access-token-removed-when-posting-facebook-sdk-4-0-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!