React Native - 无法让 Android sms-otp 自动填充工作
我正在使用 0.66(也尝试过 0.68rc4),但无法让 otp 自动填充在 Android 上运行。这是我
<Input
...
autoComplete="sms-otp"
...
/>
尝试过的组件 https://github.com/faizalshap/react- native-otp-verify 库并且它可以工作,但我正在看看我是否可以使用 RN 提供的内容(如果可能的话)。 SMS 还附加了正确的 app_hash,因此能够使用上面的库,但不能使用开箱即用的解决方案。
有人有什么建议吗?
I am using 0.66 (and also tried 0.68rc4) and am unable to get the autofill for otp to work on Android. Here is the component I have
<Input
...
autoComplete="sms-otp"
...
/>
I tried the https://github.com/faizalshap/react-native-otp-verify library and it works, but am seeing if I can go with what RN provides if possible. The SMS is also appended with the correct app_hash, hence able to use the library above, but not with the out of box solution.
Does anyone have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Android:Google SMS 检索器 API
https://github.com/ Rajat421//react-native-sms-retriever-api#readme
对于 iOS:
您将使用 TextInput 的 props textContentType
您可以使用此示例进行测试:
Apple 帐户
在真实设备上进行测试,并连接已在 - React Native 如何从移动短信中自动获取文本字段中的 OTP,应该同时支持 ios 和 android?
For Android : Google SMS Retriever API
https://github.com/Rajat421//react-native-sms-retriever-api#readme
For iOS :
You will use props textContentType of TextInput
You can test before with this example :
Tested on real device, and connect with the Apple account
already answered in - React Native How to auto fetched the OTP in the textfield from the mobile sms,should support both ios and android?