Reputation: 857
I want to direct users to the app store when they hit the "download" button on my website.
It works fine when they do it in Safari, but some apps like Reddit embed the browser inside their own app. Every once in a while I see a problem where itunes.com is rendered rather than opening up the app store. Is there a better way of opening up the app store?
var url = "https://itunes.apple.com/us/app/snapchat/id447188370?mt=8"
window.open(url,'_blank');
Upvotes: 1
Views: 6816
Reputation: 58139
You should detect if the user uses a web view (this is covered in this question).
After that, you should use the itms-apps
URL scheme if you want to open the App Store directly. It should statically contain
itms-apps://itunes.apple.com/app/
...followed by the application's unique identifier:
id447188370
So, the full URL is:
itms-apps://itunes.apple.com/app/id447188370
Upvotes: 2