HTML ページのスクリプト タグに次のコードがあります。
window.fbAsyncInit = function () {
if (FB != null) {
FB.init({
appId: 'myAppID',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
FB.getLoginStatus(function (response) {
console.log("callback");
}, true);
}
};
(function () {
var e = document.createElement('script'); e.async = true;
var protocol = "http:";
if (document.location.protocol == "https:")
protocol = "https:";
e.src = protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
ページは、FB のアプリ設定で登録されたドメインと一致するドメインから Android WebView に読み込まれます。
明確な理由はありませんが、コールバックは起動しなくなりました。昨日は機能しましたが、コードやアプリの設定を変更しない限り、今日は機能しません。
getLoginStatus 呼び出しの前に console.log() 呼び出しを配置しましたが、呼び出し自体に到達して実行されているようです。また、いくつかのファイルが static.ak.facebook.com から読み込まれていることもわかります。コールバックが呼び出されていないだけです。
アプリケーションはサンドボックス モードではないため、他のユーザーにこの動作を引き起こした可能性があります。
また、同じコードがスタンドアロン ブラウザー (デスクトップとモバイル) でも完全に機能することにも言及する必要があります。
何を与える?