Issue
I am trying to create and run Espresso UI tests for my android application.
The application uses phone number (sms) authentication. https://firebase.google.com/docs/auth/android/phone-auth
And every activity needs authenticated user info. (So I can not test any activity without login.)
How can i get "Incoming SMS Verification Code" and authenticate automatically?
Solution
When a verification message is received on the user's device, Play services explicitly broadcasts to your app a SmsRetriever.SMS_RETRIEVED_ACTION Intent, which contains the text of the message. Use a BroadcastReceiver to receive this verification message.
In the BroadcastReceiver's onReceive handler, get the text of the verification message from the Intent's extras
For more infos click here.
Answered By - Ilyes GHOMRANI
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.