Hi Team,
I Implimented WebOTP in my Angular application and it's working perfect in Android chome browser but when i tested in Iphone 13 IOS Chome browser then it's not working due to first if condition getting failed --> if ('OTPCredential' in window) {
Below is code is used:
try {
if ("OTPCredential" in window) {
try {
if (navigator.credentials) {
const ac = new AbortController();
setTimeout(() => {
ac.abort();
}, 60 * 1000);
let o = {
otp: { transport: ['sms'] },
signal: ac.signal
};
await navigator.credentials.get(o).then((otp: any) => {
alert(otp['code'])
ac.abort();
}
}).catch((err) => {
console.log(err);
});
};
}
catch (e) {
console.log(e)
}
}
}
catch (e) {
console.log(e)
}
Please help..

benjaminlouisPosted Mar 23, 2024, 4:19 AM
click here
Pramod SinghPosted Mar 7, 2024, 8:55 AM
No it's not working. Basically i need to onpaste event wheile user click on his iphone chrome browser once he got the message. then it's going to get those otp at typescript file in angular. so is there any way ?
Batista DavePosted Feb 21, 2024, 7:33 AM
Troubleshooting WebOTP in Angular applications for both Android and iOS requires a meticulous approach. Ensure you've followed the standards and prerequisites for WebOTP implementation, including compatibility with Android and iOS browsers. Check if the necessary permissions are granted, and validate the integration with respective OTP providers. Debugging tools like Chrome Developer Tools or Safari Developer Tools can help diagnose issues. Additionally, consider testing on different devices and browser versions to pinpoint platform-specific discrepancies. If issues persist, consult Angular development services and WebOTP documentation, or seek assistance from relevant forums or communities for targeted support.
Jayraj ChhayaPosted Feb 20, 2024, 1:18 PM
I think the problem lies in the way WebOTP is supported on different platforms. While Android devices support the
OTPCredentialinterface, iOS devices do not have native support for it.The condition
if ("OTPCredential" in window)fails on iOS devices, leading to the code block not being executed.Try this code might be it work