GithubHelp home page GithubHelp logo

Comments (6)

douglasjunior avatar douglasjunior commented on June 14, 2024

How are you testing?

onExpire takes a while to run, I'm not sure how long to wait.

from react-native-recaptcha-that-works.

misterharsh avatar misterharsh commented on June 14, 2024

Yes, I've only gotten it to trigger maybe once and couldn't reproduce ever since. At the time, I had an alert inside the callback that ran.

However, now even with alerts or console.logs or just a simple set state to clear the token in the parent component of the Recaptcha, nothing triggers.

I was expecting that whenever the Recaptcha expires and you get that expiration text in red in the Recaptcha box, or even in the background after having gotten a token, the callback would execute. I am trying to manually close the Recaptcha, reset the token, and set my own error message in the register form on expire or error.

from react-native-recaptcha-that-works.

douglasjunior avatar douglasjunior commented on June 14, 2024

Got it, thanks for the information.

Please, could you add a console.log(content) on line 121 to print the messages returned by webview?

const handleMessage = useCallback((content) => {

from react-native-recaptcha-that-works.

misterharsh avatar misterharsh commented on June 14, 2024

console.log(content) prints: {"dispatchConfig":null,"_targetInst":null,"_dispatchListeners":null,"_dispatchInstances":null,"nativeEvent":null,"type":null,"target":null,"eventPhase":null,"bubbles":null,"cancelable":null,"defaultPrevented":null,"isTrusted":null}

and console.log(content.nativeEvent.data) right below that line prints:
{"close":[]} after you click the checkbox but dont select the images, and just let it expire.

from react-native-recaptcha-that-works.

misterharsh avatar misterharsh commented on June 14, 2024

{"dispatchConfig":null,"_targetInst":null,"_dispatchListeners":null,"_dispatchInstances":null,"nativeEvent":null,"type":null,"target":null,"eventPhase":null,"bubbles":null,"cancelable":null,"defaultPrevented":null,"isTrusted":null}

{"load":[]}

prints when you first get the checkbox to show up.

from react-native-recaptcha-that-works.

douglasjunior avatar douglasjunior commented on June 14, 2024

Just to clarify, the expire event should ONLY happen after you successfully get the token and wait a long time without using it.

If you open and close the captcha without solving the challenge, the expire will never happen.

But something that came to my mind now, if you get the token and close the webview, the expire will also never happen as the recaptcha component has been destroyed.

Unfortunately there is no way out, I can only document this as a known limitation.

from react-native-recaptcha-that-works.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.