【发布时间】:2016-09-24 21:33:39
【问题描述】:
我正在使用 FirebaseUI-Authentication。使用电子邮件或 Google 帐户登录成功,但使用 Facebook 登录无效。在 AuthUI 活动启动并尝试使用 Facebook 登录后,不会调用 onActivityResult()。尝试登录后,应用程序卡在加载窗口。 logcat 输出 FirebaseApp 日志:
通知后台状态更改侦听器。
在 Facebook 应用程序仪表板上,我设置了 有效的 OAuth 重定向 URI,正如 firebase 指南所述,我将应用程序设置为公开(它是公开的还是处于开发状态有关系吗?)。 在 Firebase 控制台中,我启用了 Facebook 登录并设置了 App ID 和 App secret。
This 是一段视频记录,显示在登录活动中单击 Facebook 登录后发生的情况。
为什么不调用onActivityResult()?
MainActivity:
/**
* Use this method to start the FirebaseUI sign in activity.
*/
public void switchToSignIn() {
this.activity.startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(
AuthUI.EMAIL_PROVIDER,
AuthUI.GOOGLE_PROVIDER,
AuthUI.FACEBOOK_PROVIDER)
.build(), RC_SIGN_IN);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RC_SIGN_IN) {
if (resultCode == this.activity.RESULT_OK) {
// user is signed in!
Log.d(Constants.TAG_LoginHandler, "Sign in result: RESULT_OK");
logUserInfo();
tryAccessMainFragment();
} else {
Log.d(Constants.TAG_LoginHandler, "Sign in result: RESULT_CANCELLED");
// user is not signed in. Maybe just wait for the user to press
// "sign in" again, or show a message
}
}
}
build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.firebaseui:firebase-ui:0.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:1.3.0'
}
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
请将视频设为公开。它是私有的
-
现已公开。谢谢!
-
可见。谢谢
-
见this。它可以帮助你。
-
没有帮助...仍然有同样的问题。
标签: android firebase facebook-authentication firebase-authentication firebaseui