I am using Facebook SDK 4.2. I have implemented AccessTokenTracker interface, which is working if token is changed.
My question is : If user got publish_permission for post something from Android app. Then I remove that permission from my Facebook account. Now in app, the token return from
AccessToken accessToken = AccessToken.getCurrentAccessToken();
This token have publish_permission, but on Facebook server permissions are changed. After removing permission from Facebook account for that app. I again run my app. Then i press on share button, then i got error
{FacebookGraphResponseException: (#200) Requires extended permission: publish_actions httpResponseCode: 403, facebookErrorCode: 200, facebookErrorType: OAuthException, message: (#200) Requires extended permission: publish_actions}
So How can I check this token is match with Facebook server token or not.
I don't think you can actively "match" the server access token, but you can use the
call to check whether the currently stored access token contain the specific permission, where
The resulting JSON will contain a
data.scopes
array containing the actual permissions.Alternatively, and I think that suits your use case better, you could also use
before triggering the share, to check whether the
publish_actions
permission is still there. Furthermore, there is the Deauthorize Callback mechanism which is triggered when users uninstall your app:See