【发布时间】:2018-03-14 14:19:56
【问题描述】:
我用过下面的插件 科尔多瓦插件短信
方法:-
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();
}
使用上面的代码从 SMS 中读取 otp 以获取低于错误的 ionic 3 任何人都可以提供帮助
file:///android_asset/www/cordova.js:第 312 行:成功错误 callbackId:SMS329868448:TypeError:无法读取属性“smsArived” 空 I/chromium:[INFO:CONSOLE(312)]“成功 callbackId 错误: SMS329868448 : TypeError: 无法读取属性 'smsArived' of null",, 来源:file:///android_asset/www/cordova.js
【问题讨论】: