Closed sivamurugan03 closed 2 years ago
@sivamurugan03 What issue are you facing? please add details about the issue and environment you are using
I would like to add few details to this issue, I couldn't try android 26, but I tried this on android 31 and the appHash is getting generated successfully, but the following code is not getting executed when a message arrives.
this.platform.ready().then(() => {
this.smsRetriever
.startWatching()
.then((res: any) => {
const otpMessage = res.Message.toString();
const regex = /[0-9]{6,6}/g;
const extractOtp = otpMessage.match(regex).toString();
console.log(extractOtp);
alert(extractOtp);
console.log(res);
})
.catch((error: any) => console.error(error));
});
My setup is "@capacitor/core": "^2.4.5", "@ionic-native/core": "^5.30.0", "@angular/common": "^11.0.0", "cordova-plugin-sms-retriever-manager": "1.0.2", "@ionic-native/sms-retriever": "^5.33.1",
Please let me know if I can help in any way.
@sivamurugan03 You can find the working example with target android version 30 and ionic 5: https://github.com/hanatharesh2712/sms-plugin-test-ionic-5
SMS retriever function is working only on the android version 26 and below. But it is not working on the android version above android26. Is there any fix for this issue?
Thanks in advance.