Open vishnulanka-dataevolve opened 11 months ago
same issue face
useEffect(() => { RNOtpVetify.getHash() .then(console.log) .catch(console.log); RNOtpVetify.getOtp() .then(p => RNOtpVetify.addListener(OTPHandler)) .catch(p => console.log(p));
return () => RNOtpVetify.removeListener();
}, []);
const OTPHandler = (message) => { console.log(message);
// const otps = getNumberFromString('number', message?.body);
// if (otps && otps.length > 0 && otps[0].length === otpLength) {
// console.log("message", message, otps);
// }
const otp = /(\d{6})/g.exec(message);
console.log("message otp", otp);
// onFillOTPData(otp);
RNOtpVetify.removeListener();
} timeout errror
i am also facing the same error here is my code snippet
async otpRead() {
console.log('otpRead--> ');
getHash()
.then(hash => {
console.log('hash--->', hash);
// use this hash in the message.
})
.catch(console.log);
startOtpListener(message => {
// extract the otp using regex e.g. the below regex extracts 4 digit otp from message
console.log('message-->', message);
const otp = /(\d{4})/g.exec(message)[1];
console.log('otp--->', otp);
});
}
Any solution?
same issue :((((
Hello, we're still encountering this issue. Could someone please assist us?
same issue, any solutions?
Please try in latest version and use hook if possible
Sometimes its showing timeout and some times its not even working. can anyone share me working example.