SMS Retriever API not working with Firebase PhoneAuth
Asked Answered
P

1

7

I developed one android application that has firebase phone number authentication. After enter phone number, firbase sent Verification OTP number via SMS. So I add and allow SMS Read permission in my application

Now as per Google Play Policy, We need to remove SMS Read permission and implement SMS Retriever API.

So I implement SMS Retriever API with SmsRetrieverClient, SMSBroadcastReceiver with necessary dependency.

I register broadcast receiver, submit phone number to firebase. I started client.startSmsRetriever(); and It successfully started with onSuccess() callback.

And also I received SMS from Firebase but SMSBroadcastReceiver not getting any callback regarding CommonStatusCodes.SUCCESS and after 5 minutes I getting callback regarding CommonStatusCodes.TIMEOUT.

So any issue regarding firebase message format or other else?

So please help me, Thanks in advance.

Pneumatology answered 13/12, 2018 at 5:24 Comment(6)
found any solutin?Filmy
I'm interested in this alsoDemythologize
@Filmy You found any solution to this. I am getting the same ?Mureil
firebase.google.com/docs/auth/android/phone-auth please refer this document in this onVerificationCompleted callback will be called if user using same number in that deviceFilmy
Please share some code as the information you have stated above were seem to be correct. Please check whether app was registered in AndroidManifest.xml. Please seelinkEnnis
@shizhen how did you solve this?Hypozeugma
V
2

Almost an answer : It can't work because the "format" of the SMS content for SMS Retriever to work is "#".... and SHA256 from the app but Firebase SMS format is different so the SMS Retriever is not "recognising" the SMS as a valid one.

Vex answered 31/12, 2018 at 17:1 Comment(1)
Is it possible now?Hypozeugma

© 2022 - 2024 — McMap. All rights reserved.