0

私は、Facebook 接続と、ユーザーが Facebook にログインする必要がある魔女の Facebook ページ タブを備えた Web サイトを持っています。

私は JS API を使用し、ポップアップを開いてユーザーが接続できるようにします。

どこでも問題なく動作しますが、7 と 8 では問題ありません。

ポップアップで開く代わりに、新しいタブで開きます。ユーザーはログインできますが、開いたままになり、空白のページにリダイレクトされます (https://www.facebook.com/dialog/permissions.request)。

ログインは成功し、ページが更新された場合、ユーザーはログインしますが、他のブラウザのようにページを更新できるように、ポップアップにして閉じてからコールバックを実行する必要があります。

誰もがこれを修正する方法について考えを持っていて、私が見つけたすべてを試しましたが、何もうまくいきませんでした。

私のコードの一部: $`

<div id="fb-root"></div>
            <script type="text/javascript">
                window.fbAsyncInit = function() {
                    FB.init({
                          appId   : '<cfoutput>#appId#</cfoutput>',
                          cookie  : true, // enable cookies to allow the server to access the session
                          oauth   : true, // OAuth 2.0
                          status  : true, // check login status
                          xfbml   : true, // parse XFBML
                          channelUrl: 'http://192.168.1.96/gocoupons/OngletFacebook/channelUrl.cfm' //custom channel
                    });
                };

                (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));

                /*(function() {
                    var e = document.createElement('script');
                    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
                    e.async = true;
                    document.getElementById('fb-root').appendChild(e);
                }());*/
                function login() {
                    //$.cookie('fbsr_<cfoutput>#appId#</cfoutput>',null);
                    FB.login(function(response) {
                        if (response.authResponse) {
                            window.location.reload();
                        }
                    }, {scope: 'email,user_checkins'});
                }
                function addToPage() {
                    FB.ui({method: 'pagetab'}, function(response){
                        $('#pageid').val(JSON.stringify(response));
                        $('#formAjoutPage').submit();
                    });
                }
            </script>

`

4

0 に答える 0