0

I know that there is a question similar to mine, but the difference between mine and the other is that I want to know how it works in two different systems. So please, help me!!!

how do I ask if user want to continue using browser or the app? IN ANDROID AND IOS. if already has the app, is it possible to take it straight to the app and if not take it to google play or app store?

My code that only takes to google play and I don't even know if it's checking for the app:

 let now = new Date().valueOf();
    setTimeout(() => {
      if (new Date().valueOf() - now > 100) return;
      window.location =
        "https://play.google.com/store/apps/details?id=app.id" ||
        "https:/google.com"; <- if it's ios, go to google?
    }, 25);
    window.location = "appname://";
  • What research did you do? A simple Google search lead me to this : https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system – Jeremy Thille Dec 17 '21 at 14:31
  • Welcome to Stack Overflow! Please review the guidelines for [ask]. This question looks very similar to https://stackoverflow.com/questions/70385844/ask-if-user-wanna-continue-using-browser-or-app asked 17 hours ago. If the other questions don't help you and you want your question to be re-opened, please [edit] this question to clearly distinguish it from them. Good luck! – jcalz Dec 17 '21 at 15:13
  • Jeremy, as far as I know, user agent is not recommended. ;) – Ravi Stelin Dec 17 '21 at 15:28

0 Answers0