Android Automatic SMS Verification using SMS Retriever API

As Google has restricted use of READ_SMS permission here is solution without READ_SMS permission.

SMS Retriever API

Basic function is to avoid using Android critical permission READ_SMS and accomplish task using this method. Blow are steps you needed.

Post Sending OTP to user’s number, check SMS Retriever API able to get message or not

Broadcast Receiver Code

Final Step. Register this receiver into your Manifest

Your SMS must as below.

Here QWsa8754qw2 is your own application 11 character hash code. Follow thisĀ link

  • Be no longer than 140 bytes
  • Begin with the prefix <#>
  • End with an 11-character hash string that identifies your app

To importĀ com.google.android.gms.auth.api.phone.SmsRetriever, Dont forget to add this line to your app build.gradle:

 

Leave a Reply

Your email address will not be published. Required fields are marked *