title: Deep link routing to Android/IOS app in vue js
body: <p>When the user visits the mobile website via android/ios iphone, it should be redirected respective apps in their phone. If they still didn't install the respective apps for the websites, they should be redirected to respective apps in play store or apple store. Inside App.vue file below changes are done.</p>
  <pre><code> const userAgent = window.navigator.userAgent;
   const isIphone = userAgent.match(/iPhone/);
   const isAndroid = userAgent.match(/Android/);
   const isIpad = userAgent.match(/iPad/);       
   
   beforeCreate: function() {
    if ((isIphone === &quot;iPhone&quot; || isAndroid === &quot;Android&quot;) &amp;&amp; isIpad === &quot;null&quot;) {
      window.location = `{yourApp}:///`;
    }
   },
   created: function() {
    if (isIphone || isAndroid) {
     setTimeout(() =&gt; {
      if (isIphone === &quot;iPhone&quot;) {
        window.location.href = &quot;https://apps.apple.com/app/id{&lt;app id&gt;}&quot;; //here add your correct app id
      } else if (isAndroid === &quot;Android&quot;) {
        window.location.href =
          &quot;https://play.google.com/store/apps/details?id=&lt;app id&gt;&quot;; //here add your correct app id
      }
     }, 2500);
    }
   }
  </code></pre>
  <p>But it won't work as I expected. I guess reason could be device identification issue. Anyone knows how to solve this issue or any other approach to do deep linking in vue js?</p>