React Native - 无法让 Android sms-otp 自动填充工作

pur*_*sai 7 sms android autofill react-native android-autofill-manager

我正在使用 0.66(也尝试过 0.68rc4),但无法让 otp 自动填充在 Android 上运行。这是我拥有的组件

<Input
  ...
  autoComplete="sms-otp"
  ...
/>
Run Code Online (Sandbox Code Playgroud)

我尝试了https://github.com/faizalshap/react-native-otp-verify库并且它有效,但我想看看我是否可以使用 RN 提供的内容(如果可能的话)。SMS 还附加了正确的 app_hash,因此能够使用上面的库,但不能使用开箱即用的解决方案。

有没有人有什么建议?

小智 0

对于 Android:Google SMS 检索器 API

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

对于 iOS :

您将使用 TextInput 的 props textContentType

<TextInput
value={this.state.codeOTP}
textContentType="oneTimeCode"
/>
Run Code Online (Sandbox Code Playgroud)

您可以使用此示例进行测试:

真机测试,并连接Apple账号

<TextInput
value={this.state.codeOTP}
textContentType="emailAddress"
/>
Run Code Online (Sandbox Code Playgroud)

已经在 - React Native 如何从移动短信中自动获取文本字段中的 OTP 中得到回答,应该同时支持 ios 和 android?