Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMS Retriever API not working with Firebase PhoneAuth

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.

like image 576
Keyur Android Avatar asked Dec 13 '18 05:12

Keyur Android


1 Answers

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.

like image 123
danysz Avatar answered Sep 23 '22 02:09

danysz