I'm going to detect webview or browser in android I want to display a banner in Android browsers. Which users click to install app. And I do not want to display this banner on the webview android.
I use this:
<?php
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == "app.mypackage") {
echo 'WebView'; }
else {
echo 'no-WebView';
}
?>
But that does not work, and displays the 'webview' in browser and webview app
There is another way to do this?
Not accurate but you could use Javascript to check the platform that the site is running on using:
navigator.platform
Possible result(s) of using this property will include: