Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stopSmsHandling function is not calling when I call startSmsHandling #15

Closed
ReactNDev opened this issue Jan 29, 2022 · 1 comment
Closed

Comments

@ReactNDev
Copy link

ReactNDev commented Jan 29, 2022

const message: SMSMessage = startSmsHandling((event: { sms?: string }) => {
console.log(event);
var otp = retrieveVerificationCode(event?.sms,4)
this.setState({ code: otp.toString() })
})

stopSmsHandling() should call automatically when we call startSmsHandling() function but it's not happing. NativeSmsListener is not stopping after allow or deny operation.

Please correct me I'm wrong ? I want to stop NativeSmsListener, how can I do that ?
Please try to reply as soon as you can.

@nilavanraj
Copy link

This works for me

  useEffect(() => { 
   const stop = startSmsHandling( ( {sms}) => {
      console.log(sms)
      stop()
    })
  }, []);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants