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

iOS sms auto fill not working #137

Open
Ibrokihimbek opened this issue May 29, 2023 · 24 comments
Open

iOS sms auto fill not working #137

Ibrokihimbek opened this issue May 29, 2023 · 24 comments

Comments

@Ibrokihimbek
Copy link

Hello, I have a problem

that is, sms autofill is not working, there is no problem on android, on android, sms is coming and it asks for permission to enter the code in the sms, but on iOS, sms is coming, but it doesn't ask for permission to write, and it doesn't write the code automatically

@Ibrokihimbek Ibrokihimbek changed the title iOS sms auto fill iOS sms auto fill not working May 29, 2023
@Tkko
Copy link
Owner

Tkko commented May 29, 2023

Hey, that's how iOS auto fill works by default (by tapping sms code on top of the keyboard).
But you can also configure a trusted domain and enter code automatically.

#132

@janlektonen
Copy link

On iOS 16 the sms autofill is not showing on top of keyboard. It used to work. But not anymore. The sms-code is received but pinput does not display it to choose.

@Tkko
Copy link
Owner

Tkko commented Jun 15, 2023

@janlektonen Have you changed anything on your side? Is sms content same?

@janlektonen
Copy link

@Tkko No nothing changed, same sms content with 6 digits to input from sms. But it's strange it's stopped working.
As I understand I don't need to change/do anything on iOS, only on Adroid right?

@Tkko
Copy link
Owner

Tkko commented Jun 15, 2023

Yeah, iOS autofill works fine out of the box, standard TextField has autofill too, speaking of which, can you replace Pinput with TextField and check if it's working properly?

@janlektonen
Copy link

I have tried again also with TextField on iOS 16.5.1. It can't get it to work and show sms code when clicking in the input field.
I also see there is a new_pinput package in pub.dev: https://pub.dev/packages/new_pinput
Something you know about @Tkko ?

@Tkko
Copy link
Owner

Tkko commented Jul 7, 2023

Hey @janlektonen, could you send me the example of SMS you are receiving?
I'm not aware of new_pinput, I don't see any improvements an author made, it's just a clone so far.

@janlektonen
Copy link

Hey @Tkko, it is just a normal Firebase push notification. I don't have any data on it. But the keyboard input don't pick the FCM up.
Maybe its because its from Firebase and not a normal sms.

Here is the documentation on what I receive: https://firebase.google.com/docs/cloud-messaging/concept-options

@Tkko
Copy link
Owner

Tkko commented Jul 7, 2023

Yeah, it should be an SMS but as a workaround you can read the push notification content in your app and set the code programmatically

controller.setText(codeFromPushNotification);

@janlektonen
Copy link

Thanks, I will do that then!

@mobikodeStudio
Copy link

@Tkko - sms autofill not working in ios with latest IOS its working in older version. any Idea what need to do this fix.

@DeveloperEC1
Copy link

@janlektonen There are message patterns for autofill to work on iOS, such as:

Verification code: 123456

Please check this message pattern example and update us.

@Tkko Add this info to your documentation, please.

@janlektonen
Copy link

Hi @DeveloperEC1 @Tkko

Using Pinput() I cant get it working. I have tried this:

autofillHints: [AutofillHints.oneTimeCode], // ios autofill on push

But it is not working. Should it not support autofillHints on ios?

@DeveloperEC1
Copy link

@janlektonen You need to press on the top of your keyboard when the SMS is received if you use the SMS format for iOS, this is the Autofill in iOS.

@janlektonen
Copy link

janlektonen commented Sep 29, 2023

@DeveloperEC1 Yes I know that there is shown a line on top of keyboard with the code and you should click there to get it into pinput.

BUT - that line is not shown anymore. It stopped working some version-updates ago. I pointed that out earlier this year.
So something changed in your code/package I guess or iOS 16 changed something or maybe Flutter SDK?

But the the OTP code is not shown anymore on top of keyboard for Firebase Push one time code notifications. It used to work earlier this year in your package.. but stopped. I think this is what people are pointing out here.

@abdullahonus
Copy link

Any update about line under keyboard? Because still doesn't work. Should I change any perm or stuf in iOS or Xcode or in project. @janlektonen @Tkko @Ibrokihimbek

Android is working.

@janlektonen
Copy link

@abdullahonus I have tried and just tested again on real ios 17 device. It's not working on ios...

@abdullahonus
Copy link

@janlektonen thank you for feed back. Can @Tkko do anything about that pleas?

@abdullahonus
Copy link

@janlektonen or any suggest from you I can try

@janlektonen
Copy link

@abdullahonus as long as you followed the guidelines here I'm not sure we can do anything else?
https://pub.dev/packages/pinput#sms-autofill

The documentation says it should be working - but I just can't get it working on a real ios device for months now...

@abdullahonus
Copy link

@janlektonen got it . So still not working we should wait for refactoring the code :/ Also thank you for ur information Mr. Jan

@Tkko
Copy link
Owner

Tkko commented Mar 18, 2024

Hey guys, I've just checked autofill on iOS 17.3.1 with Flutter 3.19.3 and when I send this SMS to my phone number the code is showing up on a keyboard.

My SMS looks like this "Hey, your sms code ie 4432"

If you are sending SMS in different language iOS might not be able to read the OTP so try to send it in English.

Please tell me, If there is anything you are doing differently.

@janlektonen
Copy link

@Tkko i can inform you that I use the Danish language template in Firebase for the sms message. Is there a way for the code to pick up the Danish language?

@Tkko
Copy link
Owner

Tkko commented Mar 18, 2024

I can't really find an exact SMS guidelines for iOS and it is a common issue but if you include the word "code" in your SMS it seems to be working fine.

We had a same issue before so I recommend to read it as well
#85

Again, the issue isn't related to Flutter, that's how it works on iOS.

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

6 participants