How to open ios app using url?
Solution 1
I handled it via my server side code:
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("com.myapp://");
setTimeout(function() {
if (!document.webkitHidden) {
location.replace("https://itunes.apple.com/app/xxxxxxxx");
}
}, 25);}
else if ((navigator.userAgent.match(/android/i)) || (navigator.userAgent.match(/Android/i))) {
location.replace("https://play.google.com/store/apps/details?id=packagename&hl=en");}
else {
location.replace("http://www.example.com");}
I put this in my www.mysite.com/download page & share this url via campaigns.
Solution 2
What you're describing is called Deferred Deep Linking (Deep Linking
refers to using a link to open your app, even directly to a specific piece of content, and Deferred
means that it works even if the app isn't installed first).
Unfortunately there's no native way to accomplish this yet on either iOS or Android. URL schemes don't work, because they always fail if the app isn't installed. Apple's new Universal Links in iOS 9 get closer, but you'd still have to handle redirecting the user from your website to the App Store
A free service like Branch.io (full disclosure: they're so awesome I work with them) can handle all of this for you though. Here's the docs page covering exactly how to create email links like you described: https://dev.branch.io/features/email-campaigns/overview/
Related videos on Youtube
Comments
-
Vivek Sinha almost 4 years
I want to open my ios app using URL schemes. I am able to open app using this. But I want if app is not installed then app store should be opened where user can download app. Is this possible? How can I do that?
EDIT Explaining question step wise:
- I have a mail in my inbox with a url.
- I click on URL then i. If app is installed in phone, app will launch. ii. Otherwise app store will be opened to download app.
Thank
-
Ronak Chaniyara about 8 yearsCheck the answer see if it help@Vivek Sinha
-
Idan about 8 yearsthere is already an answer to that, please see this answer here: stackoverflow.com/a/3808757/1447518
-
dr0i about 8 yearsPossible duplicate of Detecting programmatically whether an app is installed on iPhone
-
Vivek Sinha about 8 yearsI want to open it from a url not from any other app. Above link is not what I want.
-
SHS over 5 yearsYou may find tutorial here medium.com/@abhimuralidharan/…
-
Vivek Sinha about 8 yearsI have just a url in mailbox, using which I want to open app (if installed) or app store (if not )
-
USER_NAME over 6 yearsOP has asked to open url from browser not from his APP
-
Mitesh Dobareeya almost 6 yearsany idea on how to handle redirecting the user from our browser to the App Store link ?
-
Alex Bauer almost 6 yearsBy 'our browser', do you mean Safari? If so, you just redirect to the App Store URL (Javascript or HTTP 3XX) and the App Store will open.
-
Alex Bauer almost 6 yearsIn theory, it should work in any browser with support for custom URI schemes...which should be all of them on iOS. I've never seen one where this didn't work, but I suppose it's possible.
-
Alberto Acuña almost 6 yearscan u write this for swift
-
Prakash almost 6 yearsHow to avoid the open confirmation dialog?