1

この問題は、ICS および Jellybean のネイティブ Android ブラウザーでアプリを表示すると、アプリに表示されたばかりでした。すべてがデスクトップ ブラウザや Android 用の Chrom でも意図したとおりに動作します。これは過去数日間に発生し、先週は正常に機能していましたが、コードは何も変更されていません。

次のコードは、私のアプリが行うことの単純化されたバージョンであり、基本的に FB への接続を開始するために行っていることです。A と B、または A と C でアラートが表示されることを期待していますが、代わりに何も起こりません。

window.fbAsyncInit = function () {
    FB.init({
        appId: '', // App ID
        channelUrl: 'http://localhost/fb/channel', // Channel File
        status: true, // check login status
        cookie: true, // enable cookies to allow the server to access the session
        xfbml: true // parse XFBML
    });

    FB.getLoginStatus(function (response) {
        alert("any response"); //<-- A
        if (response.status == 'connected') {
            alert("connected"); // <-- B
        } else {
            //somehow user was not already signed in or did not fully authorize
            FB.login(function (response) {
                if (response.authResponse) {
                    alert("connected"); // <-- C
                } else {
                    console.log('User cancelled login or did not fully authorize.');
                }
            });
        }
    });
};

// Load the SDK Asynchronously
(function (d) {
    var js, id = 'facebook-jssdk',
        ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) {
        return;
    }
    js = d.createElement('script');
    js.id = id;
    js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    ref.parentNode.insertBefore(js, ref);
}(document));

同じことを経験していて、回避策または解決策を持っている人はいますか?

4

0 に答える 0