Is there a way to determine if a visitor is viewing our site as a web app on their home screen or regularly through safari on ipad?
I figured it out:
Make sure proper web app meta info is there:
<head>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
Then add this script
<script>
if (window.navigator.standalone == true) {
document.write('<p>Welcome Home</p>');
}else{
document.write('<p>Tap the + button and choose "Add to Home Screen"</p>');
document.write('<link rel="apple-touch-icon-precomposed" href="[email protected]"/>');
}
</script>
</head>
So, window.navigator.standalone
will be true IF they are viewing in the fullscreen web app mode. Super.
Source: This is for iphone but it works the same and is where i figured out how to do it: http://www.bennadel.com/blog/1950-Detecting-iPhone-s-App-Mode-Full-Screen-Mode-For-Web-Applications.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With