signInWithCredential:failure
com.Google.firebase.auth.FirebaseAuthUserCollisionException: An account already exists with the same email address but different sign-in credentials. Sign in using a provIDer associated with this email address.
阅读本article.是否与article中提到的问题相同?有没有相同的解决方案..
解决方法 在通过互联网和firebase文档本身进行研究之后,我使用firebase auth在app中找到了这个两步验证的解决方案.firebaseAuth.getCurrentUser().updatePhoneNumber(credential).addOnCompleteListener(this,new OnCompleteListener<VoID>() { @OverrIDe public voID onComplete(@NonNull Task<VoID> task) { if (task.isSuccessful()) { Log.d(TAG,"signInWithCredential:success"); Snackbar.make(findVIEwByID(androID.R.ID.content),"Mobile VerifIEd Successfully.",Snackbar.LENGTH_SHORT).show(); } else { Log.w(TAG,"signInWithCredential:failure",task.getException()); if (task.getException() instanceof FirebaseAuthInvalIDCredentialsException) { //mVerificationFIEld.setError("InvalID code."); Snackbar.make(findVIEwByID(androID.R.ID.content),"InvalID Code.",Snackbar.LENGTH_SHORT).show(); } else { Toast.makeText(context,"signInWithCredential:failure"+task.getException(),Snackbar.LENGTH_LONG).show(); } } } });
只需将PhoneAuthCredential传递给上述方法,它就会验证手机是否已分配给您现有的帐户.确保任何其他帐户都不使用它.
PhoneAuthCredential credential = PhoneAuthProvIDer.getCredential(verificationID,code);总结
以上是内存溢出为你收集整理的android – Firebase电话身份验证凭据链接与firebase中的Google登录全部内容,希望文章能够帮你解决android – Firebase电话身份验证凭据链接与firebase中的Google登录所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)