0

c#SDKを使用してアプリケーションを作成しました。

キャンバスページは正常に機能しており、クライアントが望むことを達成するために作成しましたが、 iframeを作成するhttps://apps.facebook.com/ApplicationNameをhttp://mywebsite/介してアプリケーションにアクセスしようとすると、ログインがスタックします。http://mywebsite/

これは、接続を押したときに表示されるものです。 ここに画像の説明を入力してください

これが権限ウィンドウで、権限が表示され、[OK]をクリックしても、何も起こりません。

コード:

<div id="fb-root"></div>
<script type="text/javascript">
    window.fbAsyncInit = function () {
       // alert("aqui estoy");
        FB.init({
            appId: '397613493644598', // App ID
            status: true, // check login status
            cookie: true, // enable cookies to allow the server to access the session
            xfbml: true  // parse XFBML
        });

        FB.Event.subscribe('auth.authResponseChange', function (response) {
            if (response.status === 'connected') {
                // the user is logged in and has authenticated your
                // app, and response.authResponse supplies
                // the user's ID, a valid access token, a signed
                // request, and the time the access token 
                // and signed request each expire
                var uid = response.authResponse.userID;
                var accessToken = response.authResponse.accessToken;
                //alert("conectado");

                // Do a post to the server to finish the logon
                // This is a form post since we don't want to use AJAX
                var form = document.createElement("form");
                form.setAttribute("method", 'post');
                form.setAttribute("action", '/Home/Login');

                var field = document.createElement("input");
                field.setAttribute("type", "hidden");
                field.setAttribute("name", 'accessToken');
                field.setAttribute("value", accessToken);
                form.appendChild(field);

                document.body.appendChild(form);
                form.submit();

            } else if (response.status === 'not_authorized') {
                  alert("Not Authorized");
                // the user is logged in to Facebook, 
                // but has not authenticated your app
              } else {
                  alert("Not logged In");
                // the user isn't logged in to Facebook.
            }
        });
    };

    // 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));
</script>
<fb:login-button perms="user_birthday,email"> Connect</fb:login-button> 

問題が何であるかはわかっているかもしれませんが、確認が必要です。

問題は、Facebookアプリのアドレスがhttpsで、私のアプリのcanva URLがhttpであるということですか?、

4

1 に答える 1

0

答えが見つかりました。ステージをテストしていて、これが発生した場合は、次のアクションを実行できます。

このリンクにアクセスしてください https://www.facebook.com/settings?tab=security

セキュア ブラウジングを無効にします (これは、アプリを公開するときだけです)。その後、アプリは正常に動作するはずです。

証明書を購入してアプリケーションを公開する準備ができたら、この機能を再度有効にします。

だから私の質問への答え: Facebook アプリのアドレスが https で、アプリの canva の URL が http であることは問題ですか?

はい_

于 2013-01-08T18:24:17.133 に答える