How to detect if the user is browsing the page using webview for android or iOS?
There are various soluti
Note: This solution is PHP-based. HTTP headers can be faked so this is not the nicest solution but you can have a start with this.
//For iOS
if ((strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile/') !== false) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari/') == false) {
echo 'WebView';
} else{
echo 'Not WebView';
}
//For Android
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == "com.company.app") {
echo 'WebView';
} else{
echo 'Not WebView';
}