Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Android equivalent of iOS 12's one-time-code auto fill?

I've implemented support in our iOS app for Apple's auto-fill of SMS one-time-codes from messages. As documented, it's trivial - you just set the type to "one time code" on your UITextField and that's all.

How to show verification code suggestion on keyboard from Message

Android (via Google Play Services) has the SMS retriever API which is much more powerful, and can take over the entire process so the user doesn't even need to press any kind of auto-fill button or see a keypad

https://developers.google.com/identity/sms-retriever/overview

The problem is, that requires a server-side change to include the app hash, and is also a pile of more work. I have vague recollections of seeing something like the iOS auto-fill keyboard thing in some Android release notes, but I can't find it, so perhaps this was a figment of my imagination.

Is there anything else on android apart from the SMS retriever API (or requiring full permissions to simply read all their SMS messages)? Or is that the best way forward on Android?

Thanks

Orion

like image 433
Orion Edwards Avatar asked Feb 03 '19 22:02

Orion Edwards


People also ask

How do I turn on autofill on Android?

Go to Settings > System > Language & Input > Advanced > Autofill service > Add service and follow the onscreen instructions to enable autofill. If you use Google as your autofill service you will be able to customize your autofill experience on Android, but it won't work the same with third-party services.

How does autofill work Android?

The autofill service attempts to determine the type of each view using heuristics. However, if your app relies on these heuristics, autofill behavior may unexpectedly change as you update your app. To ensure that the autofill service correctly identifies your app's form factors, you should provide autofill hints.

How do I get SMS code for Android?

Click on the “SMS Phone Number" button. Next, click on the "Get SMS Token" button. A 6-digit code will be sent to your cellphone number to ensure you have access to the cellphone number you entered.


2 Answers

Well some months ago, Google came up with another API as SMS User Consent API. : https://developers.google.com/identity/sms-retriever/user-consent/overview

And now recently I came across the SMS one-time code autofill (the release note you had mentioned) in Android as well. I'm not sure if the behavior is exactly the same as iOS but i assume it serves almost the same idea.

You can find it at :

https://developer.android.com/guide/topics/text/autofill-services#sms-autofill https://developer.android.com/guide/topics/text/autofill-optimize#one-time_password_otp

like image 125
Shrimantee Roy Avatar answered Oct 21 '22 03:10

Shrimantee Roy


upd

Google add auto-fill to the latest version of play services https://9to5google.com/2020/02/10/autofill-code-google-messages/

google Auto fill

like image 1
Joao Avatar answered Oct 21 '22 02:10

Joao