Skip to content

Unable to autofill code with sms code #25

Closed

Description

@matanelgabsi

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!

Activity

  1. retyui commented on Nov 29, 2018

    @retyui
    Owner

    IOS ?

  2. matanelgabsi commented on Nov 29, 2018

    @matanelgabsi
    Author

    Oh sorry, yes :)

  3. retyui commented on Nov 30, 2018

    @retyui
    Owner

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

  4. retyui commented on Nov 30, 2018

    @retyui
    Owner

    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

  5. gangadhartinmen commented on Dec 12, 2018

    @gangadhartinmen
    savingfromsms __________________________________________________________________

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

  6. gangadhartinmen commented on Dec 12, 2018

    @gangadhartinmen

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

  7. retyui commented on Dec 19, 2018

    @retyui
    Owner
  8. retyui commented on Dec 29, 2018

    @retyui
    Owner

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

  9. retyui commented on Dec 29, 2018

    @retyui
    Owner
  10. gangadhartinmen commented on Dec 31, 2018

    @gangadhartinmen

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

  11. matanelgabsi commented on Dec 31, 2018

    @matanelgabsi
    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!

  12. gangadhartinmen commented on Jan 2, 2019

    @gangadhartinmen
    otp_ios_save __________________________________________________________________
  13. gangadhartinmen commented on Jan 2, 2019

    @gangadhartinmen

    Thank you so much. Its working.

  14. retyui commented on Jan 2, 2019

    @retyui
    Owner

    Today I will finish with fix IOS bags and updated documentation

  15. retyui commented on Jan 3, 2019

    @retyui
    Owner

    Thanks for your feedback! The component got better

  16. mariomurrent-softwaresolutions commented on Mar 20, 2021

    @mariomurrent-softwaresolutions

    Should this also work for Android?

  17. retyui commented on Mar 22, 2021

    @retyui
    Owner
  18. mariomurrent-softwaresolutions commented on Mar 22, 2021

    @mariomurrent-softwaresolutions

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

  19. retyui commented on Mar 22, 2021

    @retyui
    Owner

    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)

  20. summerkiflain commented on Apr 1, 2021

    @summerkiflain

    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?

  21. mariomurrent-softwaresolutions commented on Apr 1, 2021

    @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

  22. summerkiflain commented on Apr 1, 2021

    @summerkiflain

    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.

  23. mariomurrent-softwaresolutions commented on Apr 1, 2021

    @mariomurrent-softwaresolutions

    What does OTP mean?

  24. mateodaza commented on May 5, 2021

    @mateodaza

    What does OTP mean?

    one time password

  25. mariomurrent-softwaresolutions commented on Apr 12, 2022

    @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?

  26. Stevemoretz commented on Oct 19, 2022

    @Stevemoretz

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions