Facebook连接的android返回空白登录屏幕?空白、屏幕、Facebook、android

2023-09-05 07:18:44 作者:你与清晨阳光

我试图使用旧的Facebook连接验证来验证我的Andr​​oid客户端,以获得必要的会话ID和其他凭证这就是需要开始使用Facebook的Web服务。

i am trying to use the old facebook connect authentication to authenticate my android client to get the necessary session id's and other credentials thats needed to start using the web service of facebook.

这个问题我有是,当我的Andr​​oid应用程序launces和尝试加载的登录页面的Facebook,这非常相同的登录页面是空白的,它只显示了Facebook的标志作为屏幕的标题。

the issue i am having is that when my android application launces and tries to load the login page for facebook, that very same login page is blank and it only displays the the facebook logo as the title of the screen.

没有登录字段或按钮可见留给我无处可登录并验证用户身份。

No login fields or buttons are visible leaving me nowhere to login and authenticate a user.

我已经尝试了两种API的一个Facebook的API连接为Android 的http:// code。 google.com/p/fbconnect-android/ ,另一种是建议使用我刚才提到的previous一个https://github.com/facebook/facebook-android-sdk/

i have tried two API's one is facebook connect api for android http://code.google.com/p/fbconnect-android/ and the other one is the official android facebook sdk that is recommended to be used instead of the previous one i have just mentioned https://github.com/facebook/facebook-android-sdk/ .

请参见下面的图片怎么看起来像我的应用程序。

please see the image below of how it looks like on my app.

下面是采用了最新的Andr​​oid SDK中的Facebook code:

Here is code that uses the latest android sdk facebook:

/**
 * Authenticate facebook network
 */
private void authenticateFacebook() {
    // TODO: move this away from this activty class into some kind of
    // helper/wrapper class
    Log.d(TAG, "Clicked on the facebook");

    Facebook facebook = new Facebook(OAUTH_KEY_FACEBOOK_API);

    facebook.authorize(this, new AuthorizeListener());
}

class AuthorizeListener implements DialogListener{

    @Override
    public void onComplete(Bundle values) {
        // TODO Auto-generated method stub
        Log.d(TAG, "finished authorizing facebook user");

    }

    @Override
    public void onFacebookError(FacebookError e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onError(DialogError e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onCancel() {
        // TODO Auto-generated method stub

    }

}

和如何使用它一个简单的例子:http://developers.facebook.com/docs/guides/mobile/

And a simple example of how to use it: http://developers.facebook.com/docs/guides/mobile/

我code是或多或少相同于上述实施例。

My code is more or less identical to the above example.

编辑:我也不太清楚logcat的是输入查询我的第一次尝试,在我的code以上,但他们被扔在当时没有任何异常或警告。只是一个空白页。

edit: i did not catch what logcat was inputing in my first attempted at my code above but their was no exceptions or warnings thrown at the time. just a blank page.

然后我尝试了一次diddnt摸摸我的code会发生什么,现在是一个装载对话视图弹出并保持他们的几分钟,直到Facebook的窗户在前看不见的的logcat输出以下错误:

i then tried it again and diddnt touch my code and what happens now is that a loading dialogue view pops up and stays their for a few minutes until the facebook windows disapears and the logcat outputs the error below:

11-18 17:26:19.913:   DEBUG / Facebook的-的WebView(783):web视图   加载网址:   https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=e???????????????????   11月18日17:27:01.756:   DEBUG / Facebook的检查(783):登录   失败:   com.kc.unity.agent.util.oauth.facebook.DialogError:   到服务器的连接被   不成功。 11月18日17:27:01.783:   DEBUG / Facebook的-的WebView(783):web视图   加载网址:   https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=???????????????

11-18 17:26:19.913: DEBUG/Facebook-WebView(783): Webview loading URL: https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=e??????????????????? 11-18 17:27:01.756: DEBUG/Facebook-authorize(783): Login failed: com.kc.unity.agent.util.oauth.facebook.DialogError: The connection to the server was unsuccessful. 11-18 17:27:01.783: DEBUG/Facebook-WebView(783): Webview loading URL: https://www.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=???????????????

请注意,客户端ID我已经修改了,原因很明显,但logcat中的其余部分是不变

please note that the client id i have amended for obvious reasons but the rest of the logcat is untouched

推荐答案

我有同样的问题,这样做的原因是因为你已经安装在您的手机上的Facebook应用程序。

I have the same problem, the cause of this is because you have a Facebook app installed on your phone.

很多的努力后,我解决了这个错误。这很简单。这是会出现误差以上 2.2 Android版本。可能是它的哈希键错误原因。

After lot of effort I solved that error. It very simple. This is error will appear above 2.2 android version. May be it's cause of hash key error.

的措施来解决这个问题

打开你的Facebook库( com.facebook.android ),它被添加为库 打开 FaceBook.java 类 在此,我们将发现私有静态最终诠释DEFAULT_AUTH_ACTIVITY_ code = 32665 。您应该更改为 DEFAULT_AUTH_ACTIVITY_ code -1 现在保存和清洁,并建立两个库和应用程序 注:

Open your facebook library (com.facebook.android) which is added as library Open FaceBook.java class In that we will found private static final int DEFAULT_AUTH_ACTIVITY_CODE = 32665. You should change to DEFAULT_AUTH_ACTIVITY_CODE to -1 Now save it and clean and build both library and your application Note :

此黑屏仅只有最新版本出现。的

 
精彩推荐
图片推荐