Detect if iOS is using webapp
iOS and Chrome WebApp behaves different, thats the reason i came to following:
isInWebAppiOS = (window.navigator.standalone == true);
isInWebAppChrome = (window.matchMedia('(display-mode: standalone)').matches);
You have to detect this by using some javascript:
<script>
if (("standalone" in window.navigator) && // Check if "standalone" property exists
window.navigator.standalone){ // Test if using standalone navigator
// Web page is loaded via app mode (full-screen mode)
// (window.navigator.standalone is TRUE if user accesses website via App Mode)
} else {
// Web page is loaded via standard Safari mode
// (window.navigator.standalone is FALSE if user accesses website in standard safari)
}
</script>
</head>
Now the extra check "standalone" in window.navigator
is needed because some browsers do not have the standalone
property and you don't want your code to crash for those browsers.