Android - facebook sdk登录窗口消失 [英] Android - facebook sdk Login window disappear

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

问题描述

我正在尝试使用Android Facebook SDK,但没有运气。
问题是Facebook登录窗口开始加载,但在任何事情发生之前它都会消失。这是一个实际的设备上的行为,仿真器一切都很好。

I am trying to use the Android Facebook SDK - but with no luck. The problem is that the Facebook Login window starts loading, but before anything happens it disappears. This is the behaviour on an actual device, on the emulator all is good.

我做了什么:


  1. 此处下载SDk

  2. 将java文件添加到我的项目。

  3. 创建了一个Facebook应用程序。

  4. 获得了密钥哈希值,并更新了Facebook应用程序

  1. downloaded the SDk from here
  2. added the java files to my project.
  3. created a facebook application.
  4. Got the Key Hash value and updated my facebook app.

但是我无法看到登录窗口。我没有看到logcat上有任何错误,只有这样:

But I cant get the Login window to appear. I dont see any error on the logcat, only this:


ActivityManager(2698):启动:Intent {cmp = com.facebook.katana /.ProxyAuth(has extras)
ActivityManager(2698):尝试启动com.facebook.katana / .ProxyAuth
ActivityManager(2698):显示com.facebook.katana / .ProxyAuth:+ 371ms(total + 466ms)

ActivityManager( 2698): Starting: Intent { cmp=com.facebook.katana/.ProxyAuth (has extras) ActivityManager( 2698): Trying to launch com.facebook.katana/.ProxyAuth ActivityManager( 2698): Displayed com.facebook.katana/.ProxyAuth: +371ms (total +466ms)

任何想法?

10X:)

编辑:
似乎将这些代码行添加到活动中问题:

It seems adding these lines of code to the activity solved the problem:

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

从这里得到: SO问题

推荐答案

p> com.facebook.katana的logcat错误来自Android的Facebook应用程序。是安装在手机上吗?听起来像是这样,你是默认单点登录(SSO)?
尝试执行您的授权为

That logcat error from com.facebook.katana is from the Android Facebook app. Is that installed on the phone? It sounds like it is and you are defaulting to Single Sign On (SSO)? Try doing your authorize as

authorize(this, PERMISSIONS, FORCE_DIALOG_AUTH, new LoginDialogListener());

避免了SSO并强制对话登录。
如果这规避了你的崩溃,那么最可能的原因是SDK和已安装的Facebook应用程序之间不匹配。他们往往比较挑剔的一起工作。如果是这样,您可能需要尝试几种不同的版本,才能找到稳定的对。

which avoids SSO and forces a dialog login. If that circumvents your crash, then the most likely cause is a mismatch between the SDK and the installed Facebook app. They do tend to be quite picky about working together. If so, you'll probably have to try several different versions of each before you find a stable pair.

这篇关于Android - facebook sdk登录窗口消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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