• 16-01-2023, 13:30:41
    #1
    Merhaba arkadaşlar, bir çok yerde gördüm nasıl yapıldığını merak ediyorum

    örnek; kaave.app/d/indir android cihazdan tıklanıldığında play store'a ios cihazdan tıklanıldığında ise apple markete yönleniyor.

    Bunu nasıl yaparım?

    Edit: Şu kod ile çalıştı arkadaşlar.

    <script>
    var userAgent = navigator.userAgent || navigator.vendor || window.opera;     // Huawei Phone must come first because its UA also contains "Android"    if (userAgent.includes("HUAWEI")) {       window.location.replace("https://appgallery.huawei.com/app/C101184875");    } else if (userAgent.includes("Android")) {        window.location.replace("https://play.google.com/store/apps/details?id=org.telegram.messenger&hl=en&gl=US");    } else if (userAgent.includes("iPhone")) {        window.location.replace("https://apps.apple.com/us/app/telegram-messenger/id686449807");    } else {        //cant be sure about device, so redirect to home page        window.location.replace("https://google.ro");    } </script>
  • 16-01-2023, 13:31:25
    #2
    Üyeliği durduruldu
    ozerx adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar, bir çok yerde gördüm nasıl yapıldığını merak ediyorum

    örnek; kaave.app/d/indir android cihazdan tıklanıldığında play store'a ios cihazdan tıklanıldığında ise apple markete yönleniyor.

    Bunu nasıl yaparım?
    Bunu bende merak ediyorum izninizle takipteyim.
  • 16-01-2023, 13:35:35
    #3
    Hocam kullandığınız tarayıcının bir user-agent'i oluyor. Bu user-agent içerisinde cihaz bilgisi ve tarayıcı sürümü tarzında bilgiler olur Google'a "my useragent" yazarsanız görebilirsiniz.

    Örneğin benim user-agent bu şekilde:
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 OPR/93.0.0.0
    Bu user-agent bilgisini yazılım üzerinden alıp örneğin javascript veya php ile alıp, Windows ise şuraya yönlendir ya da Android ise şuraya yönlendir şeklinde yön verebiliyoruz.
  • 16-01-2023, 13:35:53
    #4
    🌐 𝘀𝗼𝗰𝗶𝗳𝗹𝘆.𝗰𝗼𝗺
    UserAgent değeri ile yakalayabilirsiniz.

    http://detectmobilebrowsers.com/
  • 16-01-2023, 13:36:19
    #5
    <!DOCTYPE html>
    <html>
    <head>
    <title>My App</title>
    </head>
    <body>

    <script>
    var isAndroid = /(android)/i.test(navigator.userAgent);
    var isiOS = /(iphone|ipad)/i.test(navigator.userAgent);
    if (isAndroid) {
    window.location.href = "https://play.google.com/store/apps/my-app";
    } else if (isiOS) {
    window.location.href = "https://itunes.apple.com/us/app/my-app/idXXXXXXXXX";
    }
    </script>

    </body>
    </html>
  • 16-01-2023, 13:55:54
    #6
    alicmkrtn adlı üyeden alıntı: mesajı görüntüle
    <!DOCTYPE html>
    <html>
    <head>
    <title>My App</title>
    </head>
    <body>

    <script>
    var isAndroid = /(android)/i.test(navigator.userAgent);
    var isiOS = /(iphone|ipad)/i.test(navigator.userAgent);
    if (isAndroid) {
    window.location.href = "https://play.google.com/store/apps/my-app";
    } else if (isiOS) {
    window.location.href = "https://itunes.apple.com/us/app/my-app/idXXXXXXXXX";
    }
    </script>

    </body>
    </html>
    bunu nasıl çalıştırırım? .html uzantısı yapıp dizine attım fakat çalışmadı
  • 16-01-2023, 14:01:50
    #7
    <script>
    var userAgent = navigator.userAgent || navigator.vendor || window.opera;     // Huawei Phone must come first because its UA also contains "Android"    if (userAgent.includes("HUAWEI")) {       window.location.replace("https://appgallery.huawei.com/app/C101184875");    } else if (userAgent.includes("Android")) {        window.location.replace("https://play.google.com/store/apps/details?id=org.telegram.messenger&hl=en&gl=US");    } else if (userAgent.includes("iPhone")) {        window.location.replace("https://apps.apple.com/us/app/telegram-messenger/id686449807");    } else {        //cant be sure about device, so redirect to home page        window.location.replace("https://google.ro");    } </script>
    şu kod ile çalıştı herkese teşekkür ederim
  • 16-01-2023, 23:47:12
    #8
    firebase dynamic links üzerinden de yapılabiliyor bu arada