question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

when I post message (window.location) Not getting nativeEvent other data in Android platform both Emulator and hardware devices.

See original GitHub issue

Bug description: when I post message (window.location) Not getting nativeEvent and other data in Android platform both Emulator and hardware devices.

To Reproduce: const INJECTED_JAVASCRIPT = (function() { window.ReactNativeWebView.postMessage(JSON.stringify(window.location)); })();;

<WebView source={{ uri: ‘https://facebook.github.io/react-native’ }} injectedJavaScript={INJECTED_JAVASCRIPT} onMessage={this.onMessage} />

onMessage = (e) => { console.log(e.nativeEvent) }

Expected behavior:

Environment:

  • OS:Android
  • OS version:8.0
  • react-native version:0.59.5
  • react-native-webview version:5.12.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
phatnextfunccommented, Jul 11, 2019

Yes, I have a similar case. onMessage did not triggering in release mode but worked in debug mode Could someone help me please?

0reactions
github-actions[bot]commented, Oct 8, 2019

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

Read more comments on GitHub >

github_iconTop Results From Across the Web

when I post message (window.location) Not getting ... - GitHub
when I post message (window.location) Not getting nativeEvent other data in Android platform both Emulator and hardware devices. #702.
Read more >
React Native WebView postMessage does not work
I had the same problem and fixed it by adding the event listener to the document instead of the window. Change: window.
Read more >
Race condition in NDK's native event handling causes ANR ...
When generating events from different sources/devices, the app freezes causing an ANR. STEPS TO REPRODUCE: 1. Build native_plasma example. 2. Connect a gamepad ......
Read more >
Window management - Android Developers
An app window on different devices. It is important to design layouts that work with different screen sizes. If you follow the Android...
Read more >
Unity - Scripting API: - Unity - Manual
Provides access to your remote settings. Rigidbody. Control of an object's position through physics simulation. NavMeshBuildDebugSettings. Specify which of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found