jarden-digital / react-native-recaptchav3

Haskkor/react-native-recaptchav3
MIT License
48 stars 77 forks source link

refreshToken not working #25

Open GSFZamai opened 2 years ago

GSFZamai commented 2 years ago

Hi there! I noticed that the call of the refreshToken on the reference stopped working on my app. For now as work around I'm using React state to render and hide the Recaptcha component. Anyone else having the same issue?

Sewb21 commented 2 years ago

Same here

GSFZamai commented 2 years ago

Hi there, i did some tests here. And seems to be related to the react-native-webview. In my case, when the react-native-webview is updated to 11.20, some way it conflicts with the recaptcha's webview dependence and refreshToken stops working. When I downgrade to 11.18, it works perfectly.

Sewb21 commented 2 years ago

Hey, so I thought this might be the case so I downgraded react-native-webview but I am using Expo on the latest SDK 46 and I encountered some build issues. I've reverted back to Expo 45 anyway for the time being due to other reasons

GSFZamai commented 2 years ago

But I did one workaround (before I downgrade webview). Created one state to show/hide my Recaptcha component, and when I need to refresh token, I set to true, after processing the token, on the end of onReceiveToken method just set to false. Every time you set true, it'll re-render and generete a new token, proccess and destroy your component.

Sewb21 commented 2 years ago

Yeah, I managed to get something like this working so I guess will have to be the solution until/if the package gets fixed. Thank you @GSFZamai 😄

amitmehtacode commented 6 months ago

Use this

https://www.npmjs.com/package/react-native-secure-captcha-v3