[英]How to get extended permission using dialog box
I need to get the extended permission for my application using JavaScript SDK. 我需要使用JavaScript SDK为我的应用程序获取扩展权限。 I found FB.Connect.showPermissionDialog
; 我发现了FB.Connect.showPermissionDialog
; but Facebook shows that it is in old JavaScript SDK. 但Facebook表示它在旧的JavaScript SDK中。 So is there any new method available in Facebook's new JavaScript SDK? 那么,Facebook的新JavaScript SDK中有没有可用的新方法?
I am developing an iframe application. 我正在开发一个iframe应用程序。
You use the new method FB.login. 您使用新的方法FB.login。 Here is the link to the documentation: http://developers.facebook.com/docs/reference/javascript/fb.login/ 这是文档的链接: 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'});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.