// Detects if device is on iOS
const isIos = () => {
const userAgent = window.navigator.userAgent.toLowerCase();
return /iphone|ipad|ipod/.test( userAgent );
}
// Detects if device is in standalone mode
const isInStandaloneMode = () => ('standalone' in window.navigator) && (window.navigator.standalone);
// Checks if should display install popup notification:
if (isIos() && !isInStandaloneMode()) {
// "IOS : Not launched form the Home Screen";
}else if (isIos()){
// "IOS : LAUNCHED form the Home Screen";
}
Last active
June 8, 2020 12:56
-
-
Save Antoinebr/edc06d1ef1a4001afd2266a43638221f to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you detect iOS 13 with this?
Never tested it but from this StackOverflow answer it seems that you will need to use an additional check for iOS 13