Reading otp SMS - using ionic

I want to build a functionality in which the app can read SMS received on the user’s app. It works as follows -

The user signs up on the app using his phone number, name etc. The server sends an SMS to the phone number with a otp .
On the next screen, the user is supposed to enter the otp received by SMS.
The above step where the user has to enter the otp could be done automatically. The screen can wait for the SMS to be received and automatically read the SMS and enter the otp and submit.

There’s an Android plugin that you could look into, it has onSMSArrive event. In theory that should allow you to listen and read the incoming SMS. I haven’t been able to get the event fire when the SMS arrives. Please let me know when you get a solution on this.

1 Like