Android的Facebook的登录工作不安装Facebook应用程序 [英] Android facebook login not working with installed Facebook app

查看:142
本文介绍了Android的Facebook的登录工作不安装Facebook应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了简单的Facebook登录。为Android 2.3.6一切正常应,用户得到提示登录对话框,输入的数据和应用程序继续。我认为这是Android的版本错,但它TURS的是,当没有安装在手机上的Facebook应用程序!

登录不工作

这个测试上: 银河王牌2.3.6 HTC Desire的4.1.2 Galaxy Note的4.1.2 Android模拟器4.1.2

即使Facebook的样品不工作!

应用程序被执行每一次 - 其他{                     Log.d(会议还没开,会话没有打开);                 }

好像会话没有打开,但为什么会这样?遵循这个指南 - <一个href="https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/">https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

code:

  Session.openActiveSession(这一点,真,新Session.StatusCallback(){

        @覆盖
        公共无效电话(最后一届会议上,SessionState会状态,例外的例外){

            如果(session.isOpened()){

                Request.executeMeRequestAsync(会话,新Request.GraphUserCallback(){

                    @覆盖
                    公共无效onCompleted(GraphUser用户,响应响应){
                        如果(用户!= NULL){
                            Log.d(Access_token,session.getAccessToken());
                        }
                    }
                });
            } 其他 {
                Log.d(会议还没开,会话没有打开);
            }
        }
    });
 

解决方案

检查出的第4步下:的https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

如果您还没有通过的WebView弹出输入您的应用程序密钥散列得当,Facebook登录(如果没有安装的应用程序)仍然可以工作,但通过原生的Facebook应用程序登录不会。

您应该可以看到这个异常LogCat中:

  com.facebook.http.protocol.ApiException:remote_app_id不匹配存储的ID
 

在Facebook的SDK打印的异常,所以检查有无论如何,如果还有其他​​的问题。

I have set up simple facebook login. For Android 2.3.6 everything works as should, user gets prompt login dialog, enters data and app goes on. I thought that it was android versions fault but it turs out that the login isn't working when there is facebook application installed on the phone!

Tested this on: Galaxy Ace 2.3.6 HTC Desire 4.1.2 Galaxy Note 4.1.2 Android emulator 4.1.2

Even the facebook samples are not working!

Every time the app is executing - else { Log.d("SESSION NOT OPENED", "SESSION NOT OPENED"); }

It seems like session isn't opened but why is that? Followed this guide - https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

Code:

Session.openActiveSession(this, true, new Session.StatusCallback() {

        @Override
        public void call(final Session session, SessionState state, Exception exception) {

            if (session.isOpened()) {

                Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {

                    @Override
                    public void onCompleted(GraphUser user, Response response) {
                        if (user != null) {
                            Log.d("Access_token", session.getAccessToken());
                        }
                    }
                });
            } else {
                Log.d("SESSION NOT OPENED", "SESSION NOT OPENED");
            }
        }
    });

解决方案

Check out the bottom of step 4: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

If you have not entered your app key hash properly, Facebook login via the WebView popup (if the app is not installed) will still work, but login via the native Facebook app won't.

You should see this exception in LogCat:

com.facebook.http.protocol.ApiException: remote_app_id does not match stored id

The Facebook SDK prints its exceptions so check there anyway if there are other problems.

这篇关于Android的Facebook的登录工作不安装Facebook应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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