Open elencho opened 6 months ago
I get it that after 5 minute listener should be removed and started again but I think it doesn't work in my case:
` const otpHandler = (message: string) => { if (message !== 'Timeout Error.') { const otpMatch = /(\d{4})/g.exec(message) const otp = otpMatch ? otpMatch[1] : ''
setValue(otp) Keyboard.dismiss() // removeListener() RNOtpVerify.removeListener() } else { startSmsListener() console.log('Timeout Error.') } } const startSmsListener = () => { if (System.isAndroid) { RNOtpVerify.getOtp() .then(() => RNOtpVerify.addListener(otpHandler)) .catch() return () => { RNOtpVerify.removeListener() } } } useEffect(() => { startSmsListener() }, [setValue])
}`
but it still doesn't work, this is logcat log i get:
I get it that after 5 minute listener should be removed and started again but I think it doesn't work in my case:
` const otpHandler = (message: string) => { if (message !== 'Timeout Error.') { const otpMatch = /(\d{4})/g.exec(message) const otp = otpMatch ? otpMatch[1] : ''
}`
but it still doesn't work, this is logcat log i get: