Link to iTunes
I want to link directly to iTunes by invoking the iTunes App (NOT through safari).
Anyone know how to do this?
Thanks!
5 Answers
-
This will work. (Thanks to Clint) BUT ONLY ON THE DEVICE. It won't work on the simulator because there is no App store App on it:
var win = Ti.UI.currentWindow; var launch_btn = Ti.UI.createButton({ title:'app store', width:120, height:35, top:0, left:0, image:'green.png' }); launch_btn.addEventListener('click',function(e){ Ti.Platform.openURL('http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284036524&mt=8'); }); win.add(launch_btn);
-
Did you try changing the http:// part of the URL to itms:// ?
-
Hmm that might not work anymore (might still open Safari). Here are Apple's instructions: http://developer.apple.com/iphone/library/qa/qa2008/qa1629.html
-
i tried dealing with this before, and couldn't figure out a way. i tried "itms://" - seems like titanium didn't know what to do with it (button i put it on just fires, and nothing happens - but, with a http url, it is just fine).
i hope there is a better way. i have a button that links directly to the reviews page for my app within the app store app. sadly, it first has to open safari, then safari opens the actual iTunes app, and then the iTunes app opens the App Store app. really round about way. but, desperate for reviews or star ratings, i found no other way. i figure something is better than nothing.
anyone else figure this out properly? is it even possible? hope it gets built in someday. maybe in titanium 3.8. haha :-(
-
It's it pretty simple, first I suggest you to use iTunes Link Maker for the specific content you want.
After you get the link itself you shall remove country code and content name to be more general.
For example if you get this link:https://itunes.apple.com/us/app/keynote/id361285480?mt=8&at=10l6dK
You can safely remove the "us" and the "keynote" and it would work on all countries:
https://itunes.apple.com/app/id361285480?mt=8&at=10l6dK
Pay attention that if you want to directly open the App Store/iTunes you must not remove the "at=…".
Moreover, If you know this link would be open on a Mac you can replace the "https" with "macappstore" so it won't open safari first and open directly the store (in case that's a mac app. on iOS 7 this problem was solved if you are using this link on older versions of iOS you shall try "itms-apps" instead of the "http" to not open safari before the app store…
Hope this clears everything out…