When I using react-native-webview, I have to set function shouldOverideUrlLoading return false. So that my script in HTML can't listen to the message I send from my Component. It worked fine in iOS but Android my function addEventListener in HTML doesn't trigger anything
My HTML javascript looks like:
console.log("checkme; data", data);
if (data.data) {
alert("checkMe:" + JSON.stringify(data.data));
symbol = data.data;
}
// initOnReady();
})
In my Component I fire postMessage to my WebView like this:
this.WebView.postMessage("hello");
In iOS, nothing wrong, but in Android, maybe shouldOverideUrlLoading stopping me to pass data from component to webview to update HTML file. So do you have another solution to pass data from component to webview, not by postMessage or I'm wrong in something? Please help me out