react-native-otp-entry icon indicating copy to clipboard operation
react-native-otp-entry copied to clipboard

Otp auto fill does not work

Open manjunath-nuveb opened this issue 1 year ago • 14 comments

Describe the bug Otp received is not showing in keyboard to autofill

To Reproduce Steps to reproduce the behavior:

  1. Generate OTP
  2. OTP received is not shown in keyboard

Expected behavior Otp received should show in keyboard

Screenshots WhatsApp Image 2024-04-27 at 12 47 28 PM

Environment (please complete the following information):

  • Device OS: Android
  • Library version: 6.0.1

manjunath-nuveb avatar Apr 27 '24 07:04 manjunath-nuveb

Hey, thank you for bringing this topic up! I investigated this issue, and it seems to me more of a problem of the OS (Android), cuz on iOS everything works fine (https://github.com/anday013/react-native-otp-entry/discussions/46#discussioncomment-9086914). May I ask you to follow these steps (https://www.reddit.com/r/AndroidQuestions/comments/tn5dfi/comment/i21lc4q/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) and lmk the outcome?

anday013 avatar Apr 27 '24 10:04 anday013

@anday013 on android I checked with other apps, autofill suggestion for other apps is working

manjunath-nuveb avatar Apr 27 '24 17:04 manjunath-nuveb

@manjunath-nuveb got it; I'll try to dig deeper into this question. Meanwhile, if you have any ideas or findings, share with me :)

anday013 avatar Apr 28 '24 09:04 anday013

@anday013 https://github.com/anday013/react-native-otp-entry/discussions/55

rob-pathway avatar Apr 28 '24 21:04 rob-pathway

@anday013 when I copy the OTP by clicking on copy when I receive the message, it shows up in the suggestion.

manjunath-nuveb avatar Apr 29 '24 09:04 manjunath-nuveb

@manjunath-nuveb is it a common flow on Android? Or it should pop up on top of the virtual keyboard automatically, without clicking copy button?

anday013 avatar Apr 29 '24 09:04 anday013

@anday013 In other android apps it is coming automatically without clicking on copy

manjunath-nuveb avatar Apr 29 '24 17:04 manjunath-nuveb

@manjunath-nuveb strange... I found this source (https://developer.android.com/guide/topics/text/autofill-optimize#otp) and it's been applied: https://github.com/anday013/react-native-otp-entry/blob/main/src/OtpInput/OtpInput.tsx#L101

anday013 avatar Apr 29 '24 19:04 anday013

Yes, I saw this code in the source. this PR has the code https://github.com/anday013/react-native-otp-entry/pull/40 but it is not working.

manjunath-nuveb avatar Apr 30 '24 16:04 manjunath-nuveb

@CarmineRumma Hi, could you please advice on this issue. A while ago, you had a similar one #40

anday013 avatar May 06 '24 14:05 anday013

@anday013 works on IOS device.

manjunath-nuveb avatar May 08 '24 08:05 manjunath-nuveb

@manjunath-nuveb yep https://github.com/anday013/react-native-otp-entry/discussions/46#discussioncomment-9086914 :)

anday013 avatar May 08 '24 13:05 anday013

@CarmineRumma does autocomplete work for you on Android?

anday013 avatar May 08 '24 13:05 anday013

Does your text message have the hash code in the message body? as it's the way to associate the text message to the sms listener on the app. if it does and still not working, try this complimentary library - https://www.npmjs.com/package/react-native-otp-verify

iaxelrad avatar May 23 '24 06:05 iaxelrad

Same issue on iOS as well. It used to work with v1.6.1

vesparny avatar Aug 26 '24 13:08 vesparny

@vesparny I have just tested on the latest version, works fine

anday013 avatar Sep 03 '24 22:09 anday013

I close this issue due to inactivity, feel free to reopen it, if there is something else here

anday013 avatar Sep 28 '24 16:09 anday013