0

We have link functionality in our web application that when clicked, browses to a page on our server that performs the following:

  1. Tries to open the custom url to our ios application
  2. If this fails, it redirects the user to our ios app store to download the app.

This actually all works perfectly well.

However, it creates a weird corner case, where after a user has done this and finished, if they come back sometime later and open their safari on the same phone, if our web link is still the active tab, it will redirect them again to our application.

The cause of this is fairly obvious, but we are struggling to come up with a solution for it. Is there any known to rectify this behavior, either through a different mechanism then I described for opening the application or through somehow killing the page simultaneously?

Brian
  • 1,513
  • 2
  • 14
  • 17
  • Did you try to opening the new link as a _blank target and changing your initial page to another one, so it will not redirect again the users? – Luca D'Alberti May 20 '15 at 14:04
  • No, but the issue is that the page performing the redirect is doing it when it loads again as the page the browser is on. How would opening a new page rectify that? Also, the custom url failure is being detected by the fact the page hasn't changed, so if I opened it in a new window, the failover to the app store would stop working. – Brian May 20 '15 at 14:16
  • 1
    Check the answer of @Alastair. What it does is, it saves the time when first loaded, then on return, the timeout triggers the code to execute, but the redirection does not occur due to the elapsed time check http://stackoverflow.com/a/16720093/408863 – Sarwar Erfan May 20 '15 at 14:18

0 Answers0