I've tested it in emulator , i'm getting hash but not getting otp. Can you please help me ?
Code :-
useEffect(() => {
getHash().then(hash => {
// use this hash in the message.
console.log(hash,"hash")
}).catch(console.log);
startOtpListener(message => {
console.log(message,"message")
// extract the otp using regex e.g. the below regex extracts 4 digit otp from message
const otp = /(\d{4})/g.exec(message)[1];
console.log(otp);
I've tested it in emulator , i'm getting hash but not getting otp. Can you please help me ?
Code :- useEffect(() => { getHash().then(hash => { // use this hash in the message. console.log(hash,"hash") }).catch(console.log);
startOtpListener(message => { console.log(message,"message") // extract the otp using regex e.g. the below regex extracts 4 digit otp from message const otp = /(\d{4})/g.exec(message)[1]; console.log(otp);
});
return () => removeListener(); },[]);