我正在开发一个Facebook画布应用程序。
尝试登录并授权我的应用程序正常运行。
但是这种情况不起作用。
{appID}
Continue as
按钮。Continue As
...进行授权。app settings
并删除我的应用。 更新:同时注销所有脸书;同样的结果!main.php
提醒我用户删除了应用(已被授权)然后注销这是我的代码:
// Load the SDK asynchronously
(function (d, s, id) {
var js,
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}
(document, 'script', 'facebook-jssdk'));
window.fbAsyncInit = function () {
FB.init({
appId: '{APPID}',
cookie: true, // enable cookies to allow the server to access
// the session
xfbml: true, // parse social plugins on this page
version: 'v2.10', // use graph api version 2.8
status: true,
oAuth: true
});
//start coding
// here trying all types of events subscribe to check if something
// missing or if I am subscribing the wrong event
FB.Event.subscribe('auth.authResponseChange', function (response) {
alert("authResponseChange=" + response);
});
FB.Event.subscribe('auth.login', function (response) {
alert("login=" + response);
});
FB.Event.subscribe('auth.statusChange', function (response) {
alert("statusChange=" + response);
});
FB.getLoginStatus(function (response) {
alert("getLoginStatus=" + response);
});
};
function ReadPHPresponse(data, cmd) {
//TODO
}
// end coding
应用环境:
stats:true
canvas URL
至https://localhost/
和应用域至localhost
https://localhost/
仍然没有触发,用户在删除我的应用时未注销。
如果我刷新main.php
它的工作,用户就会被注销。
我看到了以下类似的问题/答案,但没有一个能解决我的问题。
why facebook FB.Event.subscribe is not working?
how to detect log out from fb using JS SDK without refreshing the page
FB JS-SDK cannot detect user logging out of FB directly
How to detect user logging out of Facebook after logging into my app?
我想知道什么是错的。
谢谢
更新:事件被解雇,但等了一个小时后;所以很可能是它的一些缓存问题!无法确定。
UPDATE2:
试图弄清楚什么是错的!我曾尝试过以下方法:
jQuery
从版本3降级为版本2 localhost
app settings
console.log
的所有内容;但没有错误返回!启用所有级别;我只收到[Violation] 'message' handler took 2450ms
Healthy
<head>
(sdk.js
)The code on this page disabled back and forward caching.
我觉得无关紧要。仍然没有快乐
以下是我的应用设置:
这太好笑了!请指教!
谢谢