簡體   English   中英

React Native - 無法讓 Android sms-otp 自動填充工作

[英]React Native - Unable to get Android sms-otp autofill to work

我正在使用 0.66(也嘗試過 0.68rc4)並且無法讓 otp 的自動填充在 Android 上工作。這是我擁有的組件

<Input
  ...
  autoComplete="sms-otp"
  ...
/>

我嘗試了https://github.com/faizalshap/react-native-otp-verify庫並且它有效,但我正在查看我是否可以使用 RN 提供的 go 如果可能的話。 SMS 還附加了正確的 app_hash,因此能夠使用上面的庫,但不能使用開箱即用的解決方案。

有沒有人有什么建議?

對於 Android:谷歌短信檢索器 API

https://github.com/Rajat421//react-native-sms-retriever-api#readme

對於 iOS:

您將使用 TextInput 的道具 textContentType

<TextInput
value={this.state.codeOTP}
textContentType="oneTimeCode"
/>

您可以使用此示例之前進行測試:

真機測試,連接蘋果賬號

<TextInput
value={this.state.codeOTP}
textContentType="emailAddress"
/>

已在 - React Native How to auto fetch the OTP in the textfield from the mobile sms,should support both ios and android? 中回答。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM