Facebook登录过程停留在permissions.request屏幕上

时间:2012-07-02 13:08:02

标签: facebook permissions dialog

我遇到了Facebook对话框的问题。

当我点击Facebook按钮时,我会看到Facebook登录屏幕。当我完成该操作后,弹出窗口将更改为permissions.request(弹出窗口中的URL为https://www.facebook.com/dialog/permissions.request?_path=permissions.request& ....“)。它显示了我要求的三条信息(基本信息,关于您,和你的生日)。 当我点击“使用Facebook登录”按钮时,弹出窗口会变为空白屏幕,尽管是网址 显示https://www.facebook.com/dialog/permissions.request,没有任何其他参数。

非常感谢任何帮助。

这是javascript,下面是我用来打开facebook对话框的html:

<script type="text/javascript" language="javascript">
/*
    window.fbAsyncInit = function () {
        FB.init({ appId: '<my app id>',
                                    channelUrl: '<MY SITE ADDRESSS>/channel.html',");
            status: true,
            cookie: true,
            xfbml: true,
            oauth: true
        });



        function CheckIfPreExistingFBLogin(response) {
            alert("check if pre existing fb login");
            if (response.authResponse) {
                alert("pre existing fb login active");
                //user is already logged in and connected
                FB.api('/me', function (response) {
                    jQuery('#<%=hdnFBUID.ClientID%>').val(response.id);
                    jQuery('#<%=hdnFBemail.ClientID%>').val(response.email);
                    jQuery('#<%=hdnFBFirstName.ClientID%>').val(response.first_name);
                    jQuery('#<%=hdnFBLastName.ClientID%>').val(response.last_name);
                    jQuery('#<%=hdnFBBirthday.ClientID%>').val(response.birthday);
                    jQuery('#<%=hdnFBPreExistingLogin.ClientID%>').val("y");
                    alert("CheckIfPreExistingFBLogin got FB data - UserID=" + response.id);
                    PostItBack();
                });
            } else {
                alert("pre existing fb login is not active");
                //user is not connected to your app or logged out
                //do nothing
            }
        }

        function CheckForNewFBLogin(response) {
            alert("try to check for new fb login");
            if (response.authResponse) {
                alert("got a new FB login");
                FB.api('/me', function (response) {
                    jQuery('#<%=hdnFBUID.ClientID%>').val(response.id);
                    jQuery('#<%=hdnFBemail.ClientID%>').val(response.email);
                    jQuery('#<%=hdnFBFirstName.ClientID%>').val(response.first_name);
                    jQuery('#<%=hdnFBLastName.ClientID%>').val(response.last_name);
                    jQuery('#<%=hdnFBBirthday.ClientID%>').val(response.birthday);
                    jQuery('#<%=hdnFBPreExistingLogin.ClientID%>').val("n");
                    alert("Check for newFBLogin got FB data - UserID=" + response.id);
                    PostItBack();
                });
                //user is already logged in and connected
                // PostItBack();

            } else {
                alert("no new FB login");
                //user is not connected to your app or logged out
                //do nothing
            }
            }
        }

        function PostItBack() {
            __doPostBack('', 'gotLogin');
        }



        // run once with current status and whenever the status changes
        FB.getLoginStatus(CheckIfPreExistingFBLogin); //updateButton1
        FB.Event.subscribe('auth.statusChange', CheckForNewFBLogin);
    };


    jQuery(document).ready(function () {

        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol
    + '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
    });
    */
</script>

and here is the code for the facebook login button in the body of the form:


<div id="fb-root" "></div>

<div class="fb-login-button" scope="user_birthday, user_about_me"> Login with Facebook </div>

1 个答案:

答案 0 :(得分:0)

这很可能是由于这个错误:FB.login does not trigger callback + does not close itself on localhost:8080,现在报告已修复。

相关问题