这段代码:
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"
我已经在每个设备上调试了两个;工作(牛轧糖)和不工作(奥利奥)但没有发现差异。
任何线索?
答案 0 :(得分:1)
在过去几天中,我得到了Firebase团队的一些帮助,以及一些今天早上这些代码如何工作(在Oreo设备上)。我没有做过任何事情,也不知道他们做了什么。