开发者

How to get extended permission using dialog box

I need to get the extended permission for my application using JavaScript SDK. I found FB.Connect.showPermissionDialog开发者_Python百科; 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.


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'});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜