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
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.
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.
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.
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
upd
Google add auto-fill to the latest version of play services https://9to5google.com/2020/02/10/autofill-code-google-messages/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With