One use case is the following.
I ask for a Facebook access token to new users with the offline_access
permission and I store it for later use. If the user remove in his settings the offline_access
permission the token becomes invalid.
I would like to be able to test (maybe using the graph API) if the token I have still have the permissions I asked for, without waiting the user to log out to try to 开发者_如何学Cmake an API call.
Just call the Permissions graph api method. You could parse the json response and look to see if "offline_access" exists or not. The url format is: https://graph.facebook.com/me/permissions?access_token=... You can access an example of it by going here and clicking the permissions link there. The
You can also use their debug tool to check a token, useful for confirming the level a token has and what it has access to for debugging:
https://developers.facebook.com/tools/debug/accesstoken/
精彩评论