prem-codemymobile / rn-google-recaptcha-v2

MIT License
2 stars 3 forks source link

Not working when I change my JS engine from JSCore to Hermes #2

Open 1fabiopereira opened 2 years ago

1fabiopereira commented 2 years ago

Not working when I change my JS engine from JSCore to Hermes, on Logcat I see the following message:

2021-10-05 18:00:24.862 18718-18915/br.com.pedallo I/ReactNativeJNI: Memory warning (pressure level: TRIM_MEMORY_UI_HIDDEN) received by JS VM, ignoring because it's non-severe
2021-10-05 18:00:25.060 18718-18718/br.com.pedallo W/ContentCatcher: Failed to notify a WebView

This problem is probably due to the fact that Hermes converts the code to bytecode on build time and when transforming it into a string to inject it into the Webview, the error occurs because the generated string is not a readable function.

When i try print function that will be injected I see it:

(function () { [bytecode] })();

The only way I can imagine to solve this is instead of injecting the function create it in the Head of the HTML.