Facebook的SDK为Android - 无法登录! [英] Facebook SDK for android - Can't Login!

查看:186
本文介绍了Facebook的SDK为Android - 无法登录!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直遵循本指南: http://developers.facebook.com/文档/指南/移动/#机器人

现在我生成的关键

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore 
| openssl sha1 -binary
| openssl base64

的指示,我这个键添加到我的Facebook应用程序,并把它传给我的code:

as instructed, and I add this key to my Facebook app and to pass it in my code:

public class FacebookSyncActivity extends Activity{
    Facebook facebook = new Facebook("THE KEY");

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.facebook_layout);

        facebook.authorize(this, new DialogListener() {
            @Override
            public void onComplete(Bundle values) {}

            @Override
            public void onFacebookError(FacebookError error) {}

            @Override
            public void onError(DialogError e) {}

            @Override
            public void onCancel() {}
        });
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        facebook.authorizeCallback(requestCode, resultCode, data);
    }

但每次我试图登录我的设备或模拟器我收到此错误信息上:

but each time I try to login on my device or the simulator I get this error message:

发生错误。请稍后再试

这看起来是对许多人的问题,因为他们可以GitHub的网页上看到
https://github.com/facebook/facebook-android-sdk/issues/74

It looks to be an issue for many people as can be seen on their github page https://github.com/facebook/facebook-android-sdk/issues/74

你怎么想的?

推荐答案

好几个小时敲打我的头撞墙后,我发现这个问题:)看来我错误地传递我产生facebook的构造函数的关键 - 当我只是需要把应用中的关键在应用页面的Facebook。我认为,这引起了很多人混淆...

Ok after many hours of banging my head against the wall I found the problem :) It seems that I mistakenly pass the Key that I generated to the facebook constructor - When I simply needed to put the Application Key from the app page on facebook. I think that this caused a confusion with many people...

这篇关于Facebook的SDK为Android - 无法登录!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆