hello guys,
i have implemented auto read sms on smsArrived
but unable to bind this OTP in ngmodel
here is my code
watchNewSMS() {
this.platform.ready().then((readySource) => {
if (SMS) SMS.startWatch(() => {
console.log('watching started');
}, Error => {
console.log('failed to start watching');
});
document.addEventListener('onSMSArrive', function (e: any) {
if (e.data.address == 'test') {
console.log(JSON.stringify(e.data))
let sms = e.data.body
let otp = sms.split('Your password reset code is ')[1].split('.')[0]
this.model_autoCapturedOtp = sms.split('Your password reset code is ')[1].split('.')[0]
console.log(this.model_autoCapturedOtp) // <--successfull
}
});
});
}
in html
<ion-item *ngIf="!autoOTPCaptured">
<ion-input [(ngModel)]="model_autoCapturedOtp" placeholder='Recovery Code'>
</ion-input>
but in html page value not showing
please help
thanks
