react-native-otp-verify icon indicating copy to clipboard operation
react-native-otp-verify copied to clipboard

Getting Timeout error as SMS message

Open khrizt opened this issue 7 years ago • 13 comments

I'm trying to use this library in my project and when no SMS is received in the 5 minutes timeout the addListener handler is called with the message "Timeout Error." (it's not a problem because the regular doesn't match). Maybe it'd better not to call the same method when a SMS is received and just log the error.

What do you think?

khrizt avatar Dec 04 '18 09:12 khrizt

Yes, but we need to notify somehow right that timeout occured. What do you think we can do :)

faizalshap avatar Dec 04 '18 10:12 faizalshap

That's true... maybe having 2 types of events and passing the event type to the javascript listener? I don't really know right now if it's possible, just a guess.

khrizt avatar Dec 04 '18 10:12 khrizt

Yes, that's possible. So there would be

{
eventType: 'SUCCESS'|'TIMEOUT' ,
message:'<MESSAGE>|Timeout Error'
}

Like this right ?

faizalshap avatar Dec 26 '18 05:12 faizalshap

How to resolve this timeout error. First time it is working fine. But, when i try getting another message it is not auto reading. It is just giving TimeOut Error.

vevnkataSukumar avatar Apr 23 '20 15:04 vevnkataSukumar

Any solution for this? I'm getting time out error as the message

Megha060199 avatar Nov 05 '20 18:11 Megha060199

The library is emitting the static message "Timeout Error". mContext .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) .emit(EVENT, "Timeout Error.");

Just check the message string in the handler if it's a "Timeout Error" then ignore it and show the error to the user otherwise parse the OTP.

meet30997 avatar Mar 05 '21 08:03 meet30997

you have to keep the SMS context as it is ex:

<#> Your Example app code: 123AB8
/Ert436gwd

menusha95 avatar Jun 21 '21 16:06 menusha95

I'm facing the same issue

ZaidQ797 avatar Aug 27 '21 09:08 ZaidQ797

please anyone can help. it was working fine. but now getting error. not calling otpHandler function.

adityamindcrew avatar Dec 16 '21 11:12 adityamindcrew

same issue

aakashtyagiwmp avatar Mar 11 '22 05:03 aakashtyagiwmp

same issue

did you find any solution for this ??

ghaoui avatar Mar 18 '22 19:03 ghaoui

i am facing same problem ... any one help

sairamreddy2211 avatar Apr 06 '22 09:04 sairamreddy2211

Had the same problem. Function returns timeout if you don't have hash code in your sms. It was not obvious.

Zuxelus avatar Oct 12 '22 12:10 Zuxelus

I have tested this and it works fine. Please make sure you have added Hash (Production hash may differ so please check) like @Zuxelus suggested In case you get the issue again feel free to reopen the issue. Thanks.

faizalshap avatar Oct 30 '22 08:10 faizalshap

Issue still happening,added hash key correctly sometimes it's working fine and sometimes it throws timeout error @faizalshap

ibrahim-foodhub avatar Apr 11 '23 04:04 ibrahim-foodhub

Issue still happening,added hash key correctly sometimes it's working fine and sometimes it throws timeout error @faizalshap

did you find any solutions?

elencho avatar Mar 13 '24 12:03 elencho