window.addEventListener variables from react native post code example
Example: react native webview postmessage example
if(navigator.appVersion.includes('Android')){
document.addEventListener("message", function (data) {
alert("you are in android OS");
});
}
else {
window.addEventListener("message", function (data) {
alert("you are in android OS");
});
}