我有强制门户网站的问题。几乎没有完成。我的申请表如下:
我已经失去了无数个夜晚,试图解决这个问题而没有成功。如果有人知道为什么会这样,我将非常感激。
let statusLogin = function () {
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
//you are loggedin
accessToken = response.authResponse.accessToken;
userID = response.authResponse.userID;
} else if (response.status === 'not_authorized') {
//loggedin but not authorized your app
alert('User is connected on facebook nut not authorized!!');
} else {
// the user isn't logged in to Facebook.
alert('User is not connected on facebook!!');
}
});
};
window.fbAsyncInit = function() {
FB.init({
appId : '00XXX811XXX0000',
status : true,
cookie : true,
xfbml : true,
version : 'v2.12'
});
FB.Event.subscribe('auth.statusChange', statusLogin);
statusLogin();
};
(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 = 'https://connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.12&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));