user4404809
user4404809

Reputation:

Access Token Removed when posting facebook sdk 4.0 in Android

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?

Upvotes: 2

Views: 7791

Answers (2)

Aj 27
Aj 27

Reputation: 2427

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);

}

Upvotes: 0

ifaour
ifaour

Reputation: 38135

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

Upvotes: 2

Related Questions