In iOS, I want to open my app from a link which is coming in mail. Link format is http://test.com on click of link if app is installed then it open the app else open the web browser. Some one please help me.
Universal links are supported since iOS9 and these are likely what you are searching for.
When you support universal links, iOS 9 users can tap a link to your website and get seamlessly redirected to your installed app without going through Safari. If your app isn’t installed, tapping a link to your website opens your website in Safari.
For iOS9 or newer, look at tilo's answer (Universal Links).
For iOS8 or older, it is more cumbersome Adding an URL Scheme to your application. This is done by doing the following steps:
Your app will now open any links that begin with "MyAwesomeApp://" Try it out in safari, type "MyAwesomeApp://test". If your app is installed on the device it will open.
The custom URL Scheme will only work on devices that has your app installed. To fix the case where the user does not have your app installed, you have to link from the email to a webpage that tries to open your app but has a http URL as a fallback:
window.location = 'MyAwesomeApp://';
setTimeout(function() {
window.location = "http://urlToMyAweSomeAppHomePage.com";
}, 1000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With