I do want to develop a web-page, a page that may redirect an iPhone towards the App Store in the event that iPhone does not have the application installed, if the iPhone has the application installed it is wanted by me to start the application.
I’ve already implemented a custom URL within the iPhone application, therefore a URL is had by me for the application that is something like
Of course this Address is invalid, the page is wanted by me to redirect towards the App shop. Is this possible at all?
I get is an error message if I don’t have the application installed on the phone and write the myapp // URL in Safari, all.
10 Answers 10
Since far as i am aware you can not, from the web browser, verify that an application is installed or otherwise not.
You could take to redirecting the device to your app, and in case absolutely nothing takes place redirect the telephone to a specified page, similar to this
Then the first row is never executed if the second line of code gives a result.
To help expand the accepted answer, you often need certainly to include extra code to carry out individuals going back to the web browser after introducing the app – that the setTimeout function will run whenever they do. So, I actually do something such as this
Like that, if there’s been a freeze in code execution (i.e., app switching), it won’t run.
iOS Safari features a function that allows you to definitely add a “smart” banner to your website that will link either to your software, when it is installed, or to the App Store.
You are doing this by adding a metatag to your web page. You may also specify a detailed software URL if you would like the software to do something special when it loads.
The process has the benefits of being simple and presenting a standard advertising. The disadvantage is that you don’t have control that is much the appearance or location. Additionally, all wagers are off if the web page is viewed in a web browser apart from Safari.
As of 2017, it seems there isn’t any way that is reliable detect a software is set up, and also the redirection trick will not work everywhere.
Its worth noting that other people already considered this in depth. If you glance at how Slack implements their “magic link” function, you are able to observe that
- It sends a contact with a regular http link (ok with Gmail)
- The internet page have button that is big links to appScheme // (ok with Chrome)
Alistair revealed in this answer that often users will return to the web browser after starting the app. A commenter compared to that response suggested that the times values used had to be changed dependent on iOS variation.
Whenever all of us had to deal with this, we discovered that the full time values for the timeout that is initial telling whether we had returned to the web browser had to be tuned, and sometimes didn’t benefit all users and products.
In the place of having an arbitrary time difference threshold to ascertain whether we had came back to the browser, it made feeling to detect the “pagehide” and “pageshow” events.
This can be offered on a server that is local e.g. python -m SimpleHTTPServer and seen on iOS Safari.
To relax and play along with it, press either the “start an installed software” or “App not installed” links. These links should cause correspondingly the Maps app or the App Store to open. You can then return to Safari to see the sequence and timing for the occasions.
(Note this will benefit Safari just. For any other browsers (like Chrome) you’d have to install handlers for the pagehide/show-equivalent occasions).
Enhance As @Mikko has stated in the feedback, the pageshow/pagehide activities we have been using are apparently not any longer supported in iOS8.