Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.2 kB
1
Indexable
Never
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script defer>
        // Function to detect the user's device and redirect to the appropriate app store
    function redirectToAppStore() {
      const userAgent = navigator.userAgent || navigator.vendor || window.opera;

      // Check if the user is using iOS
      if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
        // Redirect to the Apple App Store
        window.location.href = 'https://apps.apple.com/sg/app/go2-scooter-sharing/id1501857527'; // Replace with your iOS app's URL
      } else if (/android/i.test(userAgent)) {
        // Redirect to the Google Play Store
        window.location.href = 'https://play.google.com/store/apps/details?id=com.oyika.go2.id'; // Replace with your Android app's URL
      } else {
        // If the device is neither iOS nor Android, handle it as needed
        console.log('Device not recognized.');
      }
    }
    // Call the function to perform the redirection
    redirectToAppStore();

  </script>
  
</body>
</html>