tttstudios / react-native-otp-input

Tiny Javascript library which provides an elegant UI for user to input one time passcode.
MIT License
528 stars 239 forks source link

AutoFill doesn't work on iOS #148

Open hubertstruminski opened 3 years ago

hubertstruminski commented 3 years ago

Hi,

I have problem with autofill feature on iOS 14.6. I have code like below:

           `<OTPInputView
              style={{width: '80%', height: 200}}
              pinCount={6}
              autoFocusOnLoad
              codeInputFieldStyle={{ backgroundColor: 'red'}}
              onCodeFilled = {(code) => {
                  console.log(`Code is ${code}, you are good to go!`)
              }}
              keyboardType="number-pad"
              onCodeChanged={(code) => {
                console.log(code);
              }}
            />`

When I received code from SMS I get hint above keyboard, but when I press this hint nothing happens. I have content of SMS like: "Ihr App Name Authentifizierungs code: 623456"

Is anyone who had similar problem like we ?

Sunnysit commented 3 years ago

Hi @hubertstruminski
Have you tested it in other iOS versions, or did it just happens on iOS 14.6? I tested your code snippet on my iOS 14.7 device, the autofill works well.

ericc0504 commented 3 years ago

The autofill isn't work on my side with iOS 14.6 on iPhone 11 Pro too, but it works with iOS 13.5.1 on iPhone XS. Will it be fixed?

hpsurekha commented 2 years ago

Hi,

might be below information will be useful.


> I'd take a look at the format of your SMS as Apple has some specific requirements for "oneTimeCode" to work. I believe some of the requirements for the SMS are:

> must contain the words code, passcode, or verification number
> the number should appear after the above words
> code must be numeric and between 3 and 8 digits without spaces
> must not be using a custom keyboard

Official ref link: https://github.com/facebook/react-native/issues/22578#issuecomment-510284853

arunpugahz commented 2 years ago

My SMS satisfies the apple requirements, but still not working. Previously it used to work.

hpsurekha commented 2 years ago

Any error? make sure your text msg has the proper format, as per the official document. ex: Hey there, Your 6-digit code: ${otp} This code is valid for 10 minutes since you sent it from the app.

arunpugahz commented 2 years ago

@hpsurekha I didn't get any errors earlier. Anyways It's working in iOS 15 as expected.

asahwells commented 1 year ago

i'm still having this error, pls has it been fixed??

dprajapati1179 commented 1 year ago

I am having the same issue any workaround for the same ?