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

Java bridge error #332

Open
spaenleh opened this issue Apr 16, 2024 · 1 comment
Open

Java bridge error #332

spaenleh opened this issue Apr 16, 2024 · 1 comment

Comments

@spaenleh
Copy link
Member

https://stackoverflow.com/questions/59158951/java-bridge-method-cant-be-invoked-on-a-non-injected-object

@spaenleh
Copy link
Member Author

Maybe the bug is in:

window.parent.postMessage(JSON.stringify(data), '*');

According to: react-native-webview/react-native-webview#323 (comment)
We should not specify the targetOrigin (second argument).

The mobile app injects window.parent as window.ReactWebView since ReactWebView is the object on which you can call the postMessage that is received by the parent.

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

1 participant