Javascript React合法电话号码上的本机Firebase电话身份验证空值 verify=async()=>{ this.isProcessing=true this.isRegistering=true const phoneNumber=`${this.currentUser.phoneDialCode}${this.currentUser.phoneNumber}` //获取对当前登录用户的引用 this.prevUser=firebase.auth().currentUser console.log('prev user',this.prevUser) 等待firebase.auth().signInWithPhoneNumber(phoneNumber) 。然后(异步(结果)=>{ this.isProcessing=false this.verificationCode=结果 console.log('==============================================') console.log('RESULTS',this.verificationCode) console.log('==============================================') 如果(!this.verificationCode.verificationId){ 这是triggerAlert先生( “错误”, “电话号码可能因使用过多而被阻止。”, 是的, ) 等待firebase.auth().verifyPhoneNumber(phoneNumber)。然后((res)=>{ console.log('ver-phon',res) }) } console.log('==============================================') console.log('Current User',firebase.auth().currentUser) console.log('==============================================') }).catch((错误)=>{ this.isProcessing=false this.loginOldUser() //this.prevUser=新用户() 这是triggerAlert先生( “错误”, “电话号码格式可能不正确。请再次检查。”, 是的, ) this.isPhoneVerified=false this.currentUser.phoneFlag=“” this.currentUser.phoneCode=“” this.currentUser.phoneDialCode=“” this.currentUser.phoneNumber=“” }) }

Javascript React合法电话号码上的本机Firebase电话身份验证空值 verify=async()=>{ this.isProcessing=true this.isRegistering=true const phoneNumber=`${this.currentUser.phoneDialCode}${this.currentUser.phoneNumber}` //获取对当前登录用户的引用 this.prevUser=firebase.auth().currentUser console.log('prev user',this.prevUser) 等待firebase.auth().signInWithPhoneNumber(phoneNumber) 。然后(异步(结果)=>{ this.isProcessing=false this.verificationCode=结果 console.log('==============================================') console.log('RESULTS',this.verificationCode) console.log('==============================================') 如果(!this.verificationCode.verificationId){ 这是triggerAlert先生( “错误”, “电话号码可能因使用过多而被阻止。”, 是的, ) 等待firebase.auth().verifyPhoneNumber(phoneNumber)。然后((res)=>{ console.log('ver-phon',res) }) } console.log('==============================================') console.log('Current User',firebase.auth().currentUser) console.log('==============================================') }).catch((错误)=>{ this.isProcessing=false this.loginOldUser() //this.prevUser=新用户() 这是triggerAlert先生( “错误”, “电话号码格式可能不正确。请再次检查。”, 是的, ) this.isPhoneVerified=false this.currentUser.phoneFlag=“” this.currentUser.phoneCode=“” this.currentUser.phoneDialCode=“” this.currentUser.phoneNumber=“” }) },javascript,firebase,react-native,firebase-authentication,react-native-firebase,Javascript,Firebase,React Native,Firebase Authentication,React Native Firebase,日志: 所以出于某种原因,在多次使用我的电话号码后,它不再返回正确的值,只返回空值。我已经有一段时间没用了,所以我不知道怎么了。我试图测试代码的重新发送,这就是为什么我不使用白名单上的数字 我添加了验证电话号码,只是想看看它是否能让我更深入地了解我的问题 对这些有什么想法吗?谢谢大家! 既然你说: 多次使用我的电话号码后,它不再返回正确的值,只返回空值 我的第一个想法是你被扼杀了 从Firebase文档中: 为了防止滥用,Firebase对在一段时间内可以发送到单个电话号码的短信数量进行了限制

日志:

所以出于某种原因,在多次使用我的电话号码后,它不再返回正确的值,只返回空值。我已经有一段时间没用了,所以我不知道怎么了。我试图测试代码的重新发送,这就是为什么我不使用白名单上的数字

我添加了验证电话号码,只是想看看它是否能让我更深入地了解我的问题

对这些有什么想法吗?谢谢大家!

既然你说:

多次使用我的电话号码后,它不再返回正确的值,只返回空值

我的第一个想法是你被扼杀了

从Firebase文档中:

为了防止滥用,Firebase对在一段时间内可以发送到单个电话号码的短信数量进行了限制。如果超过此限制,电话号码验证请求可能会被限制。如果在开发过程中遇到此问题,请使用其他电话号码进行测试,或者稍后重试该请求


不过我周末没用过我的电话号码。从上周开始也是这样。我使用了我的另一个电话号码和一个同事的电话号码,他们上周工作过,但这周他们似乎也被屏蔽了。奇怪的是,即使firebase返回空值,它们也会出现在firebase的“身份验证”选项卡中。在这种情况下,我不知道会发生什么。如果您看到没有为项目中的任何用户发送任何文本,您可能需要检查您是否仍在该项目的使用配额内。如果这也不能解释的话,在故障排除中寻求个性化帮助。如果我们使用新号码,我们仍然可以收到短信和所有信息。我怀疑我在两周内就拿到了1000英镑。谢谢你的链接!我没有看到他们有支持链接(我真是太蠢了)。