Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to autofill code with sms code #25

Closed
matanelgabsi opened this issue Nov 29, 2018 · 28 comments
Closed

Unable to autofill code with sms code #25

matanelgabsi opened this issue Nov 29, 2018 · 28 comments

Comments

@matanelgabsi
Copy link

Hi there,
First of all - Love your work. This library saved me a lot of time :)
I currently have an issue with it - when I try to "paste" a code using the SMS code autocomplete (when you receive a code via SMS, and you can press on in like other auto complete suggestions), I get the wrong code.
Tried to debug it a bit, and it seems that handlerOnChangeText receives the code one char at a time, but as a whole. for example, if the code is 123456. then the text will be 1 for the first time, 12 for the second, 123 for the third etc.
As a workaround, I've changed text = text[0]; to text = text[text.length - 1]; (and changed maxLength to code length) but this is probably not the best idea..
BTW, tried canPasteCode but as you can understand it didn't solve the issue.
Any ideas?

Thanks!

@retyui
Copy link
Owner

retyui commented Nov 29, 2018

IOS ?

@matanelgabsi
Copy link
Author

Oh sorry, yes :)

@retyui
Copy link
Owner

retyui commented Nov 30, 2018

I do not have such devices to test the problem, but no one bothers you to create a PR

@retyui
Copy link
Owner

retyui commented Nov 30, 2018

BTW, tried canPasteCode but as you can understand it didn't solve the issue

it is rather strange, just for this feature this flag was developed

@gangadhartinmen
Copy link

gangadhartinmen commented Dec 12, 2018

savingfromsms __________________________________________________________________

Facing the same problem in IOS when copying through SMS.
Could any one help me, to solve this?

@gangadhartinmen
Copy link

It is getting pasted in 1st block with 3 dot symbols.

@retyui
Copy link
Owner

retyui commented Dec 19, 2018

#26

@retyui
Copy link
Owner

retyui commented Dec 29, 2018

@gangadhartinmen
Can you try next version yarn add react-native-confirmation-code-field@next
and tell me Is is work?

@retyui
Copy link
Owner

retyui commented Dec 29, 2018

@matanelgabsi ^

@gangadhartinmen
Copy link

Thanks. Will test it by today EOD and let you know.

@matanelgabsi
Copy link
Author

Hi @retyui , tested it now, and it works!
but for some reason this version broke something for me. I can't add a placeholder for the input. I define:

inputProps={{ placeholder: "-", style: { fontSize: 16 }, placeholderTextColor: "#1E2B66" }}

Am I missing something?

thank you!

@retyui
Copy link
Owner

retyui commented Dec 31, 2018

@gangadhartinmen
Copy link

gangadhartinmen commented Jan 2, 2019

otp_ios_save __________________________________________________________________

@gangadhartinmen
Copy link

Thank you so much. Its working.

@retyui
Copy link
Owner

retyui commented Jan 2, 2019

Today I will finish with fix IOS bags and updated documentation

@retyui retyui closed this as completed Jan 3, 2019
@retyui
Copy link
Owner

retyui commented Jan 3, 2019

Thanks for your feedback! The component got better

@dhavalpanchani
Copy link

@retyui : Good job, Keep it up. I was looking for the autofill SMS, I think I can use this.

@mariomurrent-softwaresolutions

Should this also work for Android?

@retyui
Copy link
Owner

retyui commented Mar 22, 2021

@mariomurrent-softwaresolutions

Hmm well this will probably not well with Expo, right?

@retyui
Copy link
Owner

retyui commented Mar 22, 2021

I didn't find API in the docs, Someone requested this feature (see https://forums.expo.io/t/built-in-android-ios-sms-listener/19361/2)

@summerkiflain
Copy link

How does this thing works with iOS, I am not getting "From Messages XXXX" above may iPhone numeric keyboard. do I need to send my message in some specific format for iOS also?

@mariomurrent-softwaresolutions

How does this thing works with iOS, I am not getting "From Messages XXXX" above may iPhone numeric keyboard. do I need to send my message in some specific format for iOS also?

Same applies for me

@summerkiflain
Copy link

How does this thing works with iOS, I am not getting "From Messages XXXX" above may iPhone numeric keyboard. do I need to send my message in some specific format for iOS also?

Same applies for me

I figured this out, you have to have OTP in message text for iOS numeric keyboard to pick it up.

@mariomurrent-softwaresolutions

What does OTP mean?

@mateodaza
Copy link

What does OTP mean?

one time password

@mariomurrent-softwaresolutions

How does this thing works with iOS, I am not getting "From Messages XXXX" above may iPhone numeric keyboard. do I need to send my message in some specific format for iOS also?

Same applies for me

I figured this out, you have to have OTP in message text for iOS numeric keyboard to pick it up.

So how does your SMS look like that it gets picked up?

@Stevemoretz
Copy link

Hi, recently Android seems to support this too according to: https://stackoverflow.com/a/71386603/10268067 so you'd need to set autocomplete to sms-otp for android to work the same way as iOS does, have you done this interanlly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants