简体   繁体   English

发生错误。 请稍后再试

[英]An error occured. Please try again later

I'm learning Android development with PhoneGap and Facebook Javascript SDK. 我正在使用PhoneGap和Facebook Javascript SDK学习Android开发。 I keep on having this error everytime I launch my application and I don't know exactly what's wrong. 每次启动我的应用程序时,我都会不断出现此错误,但我不知道到底是什么问题。 Could you please help me? 请你帮助我好吗?

These are the following details : 这些是以下详细信息:

Project Location : D:\\Android Dream\\FacebookExercise\\assets\\www\\index.html 项目位置: D:\\ Android Dream \\ FacebookExercise \\ assets \\ www \\ index.html

Localhost Location : C:\\Program Files\\Apache Software Foundation\\Tomcat 7.0\\webapps\\ROOT\\ Localhost位置: C:\\ Program Files \\ Apache Software Foundation \\ Tomcat 7.0 \\ webapps \\ ROOT \\

I'm very sure my APP_ID is correctly set. 我非常确定我的APP_ID设置正确。 These are some settings of my FB : 这些是我的FB的一些设置:

Website with Facebook Login 使用Facebook登录的网站

Site URL: http://localhost:8080/

Mobile Web 行动网路

Mobile Site URL: http://localhost:8080/

index.html index.html

<html>
<header>
    <title>Kissa Android App</title>
    <script type="text/javascript" charset="utf-8" src="cordova-2.5.0.js"></script>
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
</header>
<body>
    <div id="fb-root"></div>
    <div id="user-info"></div>
    <script type="text/javascript">
        var isLoaded = false;
        // Additional JS functions here
        window.fbAsyncInit = function() {
            FB.init({
                appId      : 'The App ID', // App ID
                channelUrl : 'http://localhost:8080/res/channel.html', // Channel File
                //channelUrl : 'http://10.0.2.2:8080/assets/www/channel.html',
                status     : true, // check login status
                cookie     : true, // enable cookies to allow the server to access the session
                xfbml      : true,  // parse XFBML
                oauth      : true
            });

            isLoaded = true;

            FB.getLoginStatus(function(response) {
                if (response.status === 'connected') {
                    //window.location = "http://www.google.com";
                } else if (response.status === 'not_authorized') {
                    // not_authorized
                    //alert("You are unauthorized to access this page.");
                } else {
                    //document.getElementById('name').innerHTML = '';
                }
            });



            FB.login(function(response) {
                if (response.authResponse) {
                    FB.api('/me', function(response) {
                        document.getElementById('name').innerHTML = 'Name : ' + response.first_name;
                        var fbLoginBtn = document.getElementById('fbLoginBtn');
                        fbLoginBtn.innerHTML = '<fb:login-button autologoutlink="true" perms="email">&nbsp;</fb:login-button>';
                        FB.XFBML.parse(fbLoginBtn);
                    });
                } else {
                    // cancelled
                }
            });

            FB.Event.subscribe("auth.logout", function() {window.location = 'index.html'});
        };

        // 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>

    <script type="text/javascript">
        function isLoaded(){
            alert("heuy!");
            if(isLoaded)
                alert(isLoaded);
            else
                alert(isLoaded);
        }
    </script>

    <fb:login-button autologoutlink="true" perms="email">&nbsp;</fb:login-button>
    <div id="fbLoginBtn">
        <fb:login-button autologoutlink="true" perms="email">&nbsp;</fb:login-button>
    </div>
    <div id="name" style="font-family : arial"></div>
    <div id="email"></div>

    <input type="button" onclick="isLoaded()" value="hey"/>

</body>

You cannot simply use the JS SDK in phonegap environment. 您不能仅在phonegap环境中使用JS SDK。 You have to use the phonegap facebook plugin, which provides the same api. 您必须使用提供相同api的phonegap facebook插件。 I have just wrote a little tutorial... http://pjsdev.blogspot.de/2013/03/phonegap-build-facebook-connect-part-2.html 我刚刚写了一个小教程... http://pjsdev.blogspot.de/2013/03/phonegap-build-facebook-connect-part-2.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 一个意料之外的问题发生了。 请稍后再试。 (4800000) - An unexpected error occurred. Please try again later. (4800000) 一个意料之外的问题发生了。 请稍后再试。 (3200000) - An unexpected error occurred. Please try again later. (3200000) Android Facebook SDK 3.0登录错误 - 发生错误。 请稍后再试 - Android Facebook SDK 3.0 Login error - An error occurred. Please try again later 登录错误:登录此应用程序时出错。 请稍后再试 - Login Error: There is an error in logging you into this application. Please try again later 登录错误:登录此应用程序时出错。 请稍后在 flutter 中重试 android 模块 - Login Error : there is an error in logging you into this application. please try again later in flutter for android module Facebook“登录错误:将您登录到此应用程序时出错。请稍后再试” - Ionic - Facebook "Login Error: There is an error in logging you into this application. Please try again later" - Ionic 一个意料之外的问题发生了。请稍后再试。 (738369013)提交给PlayStore时 - An unexpected error occurred. Please try again later. (738369013) when submitting to PlayStore Android版Facebook SDK“ MyApp发生错误。 请稍后再试” - Facebook SDK for Android “An error has occurred with MyApp. Please try again later” Google Play 开发者控制台 - 发生意外错误。 请稍后再试 - Google Play Developer Console - An unexpected error occurred. Please try again later Facebook SSO示例不起作用 - “发生错误。请稍后再试” - Facebook SSO example not working - “An error ocurred. Please try again later”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM