Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 4 read SMS plugin for OTP Verification

I am developing the ionic4 app, to auto verification or whenever I will get SMS my app has to read that message. for this I used 'Cordova plugin add Cordova-plugin-SMS' but it is not working. i declared 'declare var window: any; and declare var SMS: any;' nothing has worked. it showing "java.lang.ClassNotFoundException: com.rjfun.cordova.sms.SMSPlugin" in Android, in the web while developing it showing " TypeError: Cannot read property 'listSMS' of undefined". can any one help me to solve this issue

like image 354
Rajesh Yadav Avatar asked Mar 14 '19 12:03

Rajesh Yadav


People also ask

Can I auto read OTP on mobile browsers?

Few things to be kept in mind while implementing the auto read functionality by using Web OTP API. The Web OTP API requires HTTPS origin, that is on HTTP website this functionality will not work. This functionality will work only on the chrome 84 or later on an Android device.


1 Answers

There is one plugin which could solve your problem. Named cordova-plugin-sms-receive. This will help to read sms when any phone received and you can do whatever you want. https://www.npmjs.com/package/cordova-plugin-sms-receive

like image 147
Govind Avatar answered Oct 17 '22 06:10

Govind