I have used below plugin cordova-plugin-sms
Methods :-
watchSMS() {
if(window.SMS) window.SMS.startWatch(function(){
console.log('Succeed to start watching SMS');
document.addEventListener('onSMSArrive', this.smsArived);
}, function(){
console.log('failed to start watching SMS');
});
}
stopWatchSMS() {
if(window.SMS) window.SMS.stopWatch(function(){
console.log('Succeed to stop watching SMS');
}, function(){
console.log('failed to stop watching SMS');
});
}
smsArived = (result: any) => {
console.log("SMS DATA 2" + smsData);
this.stopWatchSMS();
}
using the above code for reading otp from SMS for ionic 3 getting below error can any one help
file:///android_asset/www/cordova.js: Line 312 : Error in Success callbackId: SMS329868448 : TypeError: Cannot read property 'smsArived' of null I/chromium: [INFO:CONSOLE(312)] "Error in Success callbackId: SMS329868448 : TypeError: Cannot read property 'smsArived' of null",, source: file:///android_asset/www/cordova.js