Android Firebase 身份验证 : federated Google login not working in Oreo

标签 android firebase firebase-authentication google-signin

这段代码:

private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
mAuth.signInWithCredential(credential)
    .addOnCompleteListener(this, task -> {
        if (task.isSuccessful()) {
            // Sign in success, update UI with the signed-in user's information
            FirebaseUser user = task.getResult().getUser();
            mMainViewModel.setGoogleLoginResult(user);
        } else {
            // If sign in fails, display a message to the user.
            mMainViewModel.setGoogleLoginResult(null);
        }
    });
}

我从这里得到的:https://firebase.google.com/docs/auth/android/google-signin

在 Nougat 设备上工作得很好,但在 Oreo 设备上不工作。

这些是我的 build.gradle:

compileSdkVersion 28
buildToolsVersion '28.0.0'

// Firebase
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-auth:16.0.2"
implementation "com.google.firebase:firebase-database:16.0.1"

我已经在每台设备上都进行了调试;工作(牛轧糖)和不工作(奥利奥)但没有发现差异。

有什么线索吗?

最佳答案

在过去的几天里,我得到了 Firebase 团队的一些帮助,以及今天早上代码如何正常工作(在 Oreo 设备上)的一些帮助。我这边什么都没做,不知道他们做了什么。

关于Android Firebase 身份验证 : federated Google login not working in Oreo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50901611/

相关文章:

Android NDK 应用程序库未找到错误

android - 在我的 Android 应用程序中使用 ServerValue.TIMESTAMP

swift - 请求失败 : forbidden (403) after adding the provided url from Firebase in the callback settings of the Twitter app

ios - 读取当前用户的数据?

javascript - 至少需要 2 次刷新才能加载页面

angular - Angularfire/Firebase 实现了哪些 OAuth Flow?

android - 将图像从 DCIM 文件夹复制到另一个文件夹会导致图像质量下降

Android/Google Play - 应用程序可以在运行时更新吗

android - 应用程序打开时停止推送通知振动

firebase - 如何检查 Firebase 数据库中是否存在项目? - react native 火力基地