请求许可无效!
我已将此代码添加到 PHP 脚本的顶部:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: 'myAppId', status: true, cookie: true, xfbml: true});
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'});
</script>
但它不起作用!为什么 ??
I have added this code on the top of my PHP script:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: 'myAppId', status: true, cookie: true, xfbml: true});
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'});
</script>
But it doesn' t work !! Why ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Facebook 不允许在画布应用程序中使用传统的 JavaScript。
如果您使用 PHP,请尝试 REST API,它具有获取扩展权限的方法。例如,在我的全局包含文件中,有以下行:
如果用户授予我指定的扩展权限,则仅允许访问我的应用程序。
希望这有帮助。
Facebook doesn't allow conventional JavaScript in canvas applications.
If you're using PHP, try the REST API which has methods for obtaining extended permissions. For example, in my global include file I have the following line:
This only permits access to my application if the user grants me the specified extended permissions.
Hope this helps.