gpt4 book ai didi

android - Firebase 手机身份验证仅在 Release模式下不启动 OTP,但即使在为 Release模式添加 sha1 后也可以在 Debug模式下工作

转载 作者:行者123 更新时间:2023-12-03 13:29:51 33 4
gpt4 key购买 nike

我如何实现的步骤。
按照建议,我一路实现。在 Debug模式下非常好。不幸的是,即使我在 Firebase 控制台中添加了我的调试和发布 sha1 键,它也不能在 Release模式下工作。
Step 1. 编码部分在这里

final PhoneVerificationCompleted verificationCompleted =
(PhoneAuthCredential user) {
successMessage('Your phone number verified successfully!');
_loginNotifier.validate();
};

final PhoneVerificationFailed verificationFailed = (FirebaseAuthException authException) {
errorMessage('Phone number verification failed. Code: ${authException.code}. Message: ${authException.message}');
print(
'Phone number verification failed. Code: ${authException.code}. Message: ${authException.message}');
};

final PhoneCodeAutoRetrievalTimeout codeAutoRetrievalTimeout =
(String verificationId) {
this._verificationId = verificationId;
print("time out");
};

firebaseAuth = FirebaseAuth.instance;
firebaseAuth.verifyPhoneNumber(
phoneNumber: '+$_phoneWithCC',
timeout: const Duration(seconds: 60),
verificationCompleted: verificationCompleted,
verificationFailed: verificationFailed,
codeSent: codeSent,
codeAutoRetrievalTimeout: codeAutoRetrievalTimeout);
第2步:
Here is the firebase console sha1 keys for debug and release mode
添加了所有三个不同的 sha1 键,但仍然无法正常工作:(
我得到的错误:
正如我所说,在 Debug模式下一切正常
但是在 Release模式下,在启动 otp 功能后,立即 PhineVerificationFailed 并带有空消息和空代码。
如果还有什么我错过的,请指教。谢谢大家

最佳答案

除了 SHA1 - 你还需要SHA256发布 apk 的指纹。
我在 firebase google 身份验证中遇到了类似的问题。
可以加一下SHA256 firebase 项目控制台的指纹并重试?

关于android - Firebase 手机身份验证仅在 Release模式下不启动 OTP,但即使在为 Release模式添加 sha1 后也可以在 Debug模式下工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63642683/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com