Question

I need to get the extended permission for my application using JavaScript SDK. I found FB.Connect.showPermissionDialog; but Facebook shows that it is in old JavaScript SDK. So is there any new method available in Facebook's new JavaScript SDK?

I am developing an iframe application.

Was it helpful?

Solution

You use the new method FB.login. Here is the link to the documentation: http://developers.facebook.com/docs/reference/javascript/fb.login/

Here is how you use it:

FB.login(function(response) {
  if (response.session) {
    if (response.perms) {
      // user is logged in and granted some permissions.
      // perms is a comma separated list of granted permissions
    } else {
      // user is logged in, but did not grant any permissions
    }
  } else {
    // user is not logged in
  }
}, {perms:'read_stream,publish_stream,offline_access'});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top