1

In our project I needed a deeplink URL for web to mobile redirection. My aim is to redirect someone on the website to a specific mobile application. Unfortunately I can not make an automatic redirection to mobile app using Chrome on Android phones. iOS works just fine. If I click on a hyperlink to redirect to mobile app on Android Chrome it works fine but automatic redirection still doesn't work.

I heard people saying that it is bug that is classified as "won't'fix". Here is a link for that explanation: Deep linking not working in chrome

However, I have seen some applications able to redirect somehow.

I am using Java 8 by the way, if you offer any back-end solutions I am also open for that.

<c:if test="${deviceClass.equals('Phone')}">
  <c:if test="${osName.equals('iOS')}">
    <p style="font-size:40px; text-align: center;"><a href="fb://page/240995729348595"><b> Open Facebook on iOS </b></a></p>
  </c:if>
  <c:if test="${osName.equals('Android')}">
    <p style="font-size:40px; text-align: center;"><a href="intent://scan/#Intent;scheme=fb://profile/838619192839881;package=com.facebook.katana;end"><b> Open Facebook on android </b></a></p>
  </c:if>
</c:if>

 <script type="text/javascript">
  $(document).ready(function() {

    var browserName = "${agentName}";
    var deviceClass = "${deviceClass}";

    if (deviceClass === "Desktop" || browserName === "Opera" || browserName === "Firefox" || browserName === "YaBrowser") {
      var timeleft = 10;
      var downloadTimer = setInterval(function() {
        timeleft--;
        document.getElementById("countdowntimer").textContent = timeleft;

        if (timeleft <= 0) {
          var link = "${redirectUrl}";
          window.location.assign(link);
          setTimeout(function() {
            window.location = www.google.com;
          }, 7000);

          clearInterval(downloadTimer);
        }
      }, 1000);
    }
  });
</script>
4b0
  • 21,981
  • 30
  • 95
  • 142

0 Answers0