I am using following code for checking whether the user opened the site in App or not
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
if(stripos($ua,'android') && stripos($ua,'mobile') !== false) {
if($_SERVER['HTTP_X_REQUESTED_WITH'] == "apppackagename") {
echo "Opening with App";
}
}
But this is not working in some devices like.
GT - S7582 Android Version 4.2.2
Is there any solution for this to work in old version devices?
Thanks in advance !