Flutter_Pinput icon indicating copy to clipboard operation
Flutter_Pinput copied to clipboard

Doesn't work on PWA WEB

Open rhomayouni opened this issue 1 year ago • 7 comments
trafficstars

Hello, the pinput library works on android correctly, but it doesn't work on mobile browser(it doesn't read opt from sms and fill the field), please help me.

rhomayouni avatar Apr 17 '24 11:04 rhomayouni

Hi, what exactly isn't working?

Tkko avatar Apr 17 '24 11:04 Tkko

In pwa mode on the mobile phone (android) when the OTP is received by SMS, the received code is not placed in the box.

Is there a special setting needed for the browser on the mobile phone?

rhomayouni avatar Apr 17 '24 11:04 rhomayouni

That's an expected behavior. The SMS retriever API only works in compiled Android app.

Tkko avatar Apr 17 '24 11:04 Tkko

i checked in 2 modes: smsUserConsentApi, smsRetrieverApi , both of them are same. in pub.dev, you told support WEB

rhomayouni avatar Apr 17 '24 11:04 rhomayouni

Sorry, forgot to mention, none of these APIs are working on the Web. If you send supposed SMS format the code will pop up on the keyboard.

The supported SMS formats aren't clear, but it seems to work in English most of the time. For example:

Code 466345

Tkko avatar Apr 17 '24 11:04 Tkko

thanks man, Even the received code is not placed at the top of the keyboard area.

rhomayouni avatar Apr 17 '24 11:04 rhomayouni

Hmm, Just checked and it's not working on Android Web. But it has to be working out of the box with TextField if you pass autofillHints: [AutofillHints.oneTimeCode],

https://api.flutter.dev/flutter/material/TextField/autofillHints.html https://api.flutter.dev/flutter/services/AutofillHints/oneTimeCode-constant.html

Tkko avatar Apr 17 '24 13:04 Tkko