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

3

8

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

Elanaeland answered 3/2, 2019 at 22:48 Comment(0)
T
1

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

Top answered 13/12, 2019 at 7:43 Comment(0)
S
1

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

Soninlaw answered 31/3, 2020 at 15:11 Comment(0)
L
0

You cannot use SMS Retriever API unless you change your SMS Template(including App Hash).

Next thing you can try is requiring full permission for SMS_READ. It used to be a common way in Android development until Google strictly prohibited granting full access of SMS Permission in Feb 2019.

If your app's core function needs these permissions, then you can contact Google Help Center or there is no way to implement SMS retrieval.

Loki answered 23/2, 2019 at 18:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.