Created
November 27, 2024 20:22
-
-
Save ano/902d65a363fdf53a6487502153446729 to your computer and use it in GitHub Desktop.
Redirect to App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>App Download</title> | |
<script> | |
// JavaScript to detect platform and redirect | |
document.addEventListener("DOMContentLoaded", function () { | |
const userAgent = navigator.userAgent || navigator.vendor || window.opera; | |
if (/android/i.test(userAgent)) { | |
// Redirect to Google Play Store for Android | |
window.location.href = "https://play.google.com/store/apps/details?id=com.smartie.merchant"; | |
} else if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { | |
// Redirect to Apple App Store for iOS | |
window.location.href = "https://apps.apple.com/nz/app/smartie-merchant/id6504093979"; | |
} else { | |
// Redirect to a fallback URL for unsupported devices or desktops | |
window.location.href = "https://www.smartie.com"; | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<h1>Redirecting to the App Store...</h1> | |
<p>If you are not redirected, <a href="https://www.yourwebsite.com">click here</a>.</p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>App Download</title> | |
<script> | |
// JavaScript to detect platform and redirect | |
document.addEventListener("DOMContentLoaded", function () { | |
const userAgent = navigator.userAgent || navigator.vendor || window.opera; | |
if (/android/i.test(userAgent)) { | |
// Redirect to Google Play Store for Android | |
window.location.href = "https://play.google.com/store/apps/details?id=com.smartie.merchant"; | |
} else if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { | |
// Redirect to Apple App Store for iOS | |
window.location.href = "https://play.google.com/store/apps/details?id=com.smartie.customer"; | |
} else { | |
// Redirect to a fallback URL for unsupported devices or desktops | |
window.location.href = "https://www.smartie.com"; | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<h1>Redirecting to the App Store...</h1> | |
<p>If you are not redirected, <a href="https://www.yourwebsite.com">click here</a>.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment