Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 30349

Android : script in HTML can't call addEventListener when I setting shouldOverUriLoading return false

$
0
0

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


Viewing all articles
Browse latest Browse all 30349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>