I am just getting acquainted with Facebook javascript SDK.
What is the proper way to check if a permission request was successful then call a function? In my case the user is being requested additional permissions. They have already given basic permissions.
Right now I have this.. but it fires the function regardless of success or not
FB.login(function (publishAuth) {
if (publishAuth.authResponse) {
authSuccess();
} else { }
}, { scope: 'publish_stream' });
}
Thanks for the help
Mark
Since the user can accept/deny each (extended) permission individually, there is no simple true/false response to a permissions request.
To check, which permissions the user has actually granted and which not, you have to make a call to
/me/permissions– see Graph API Explorer example.(With field expansion you can do it also in one call while requesting other infos about the user – f.e.
/me?fields=id,name,permissions)