Skip to content

Conversation

dat-boris
Copy link

@dat-boris dat-boris commented Aug 16, 2025

The latest version ~2.4.* is broken on Android. This is due to an oddity in react-native-webview/react-native-webview#356 that the addEventListener needs to be modified for Android WebView. This now fixes the issue.

The previous web version is also broken if we host the iframe on a different domain due to the cross-origin policy. This also ensures that we are more relaxed on targetOrigin.

Fixes #378

Testing

Tested on:

"react-native": "0.79.5"
"react-native-webview": "13.13.5"
  • works on iOS
  • works on Android
  • works on web-webview (cross orign)

@dat-boris
Copy link
Author

cc @LonelyCpp - thanks for the project! The latest version is broken on android #378

added a fix for this.


if (window.ReactNativeWebView) {
// React Native WebView
window.ReactNativeWebView.postMessage(JSON.stringify(msg));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: An interesting quirk is that adding targetOrigin here will break Android native.

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

Successfully merging this pull request may close these issues.

Auto play not working in android 16
1 participant