How to launch App Store from my iPhone application?

Featured Image

This is easy. Just follow the steps below and you will be over in less then minute.

  • Launch iTunes on your Mac.
  • Search for the item you want to link to.
  • Right-click or control-click on the item’s name in iTunes, then choose “Copy iTunes Store URL” from the pop-up menu.
    itunes_link1
  • The returned URL is an itunes.apple.com link. However, iPhone requires phobos URLs for direct linking to the App Store.
  • Therefore, you must replace itunes with phobos in the returned URL.
  • Open the modified URL using an NSURL object and the -[UIApplication openURL] method.
- (IBAction)appStoreLink {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301349397&mt=8"]];
}

Now when you press button linked with appStoreLink IBAction, App Store application will open and you will see Divine Office application. That’s all.

26
Top

Care to rate this post?

Author

Ivan Kalaica

Ex. Inchooer

At Inchoo, Ivan Kalaica was an iOS SDK developer. He worked with us from 2008. to 2012.

Other posts from this author

Discussion 26 Comments

Add Comment
  1. thanks. i really needed this. 45 mins before i leave the office too. haha cutting it close :)

    thanks again.

  2. And if you have an iTunes affiliate account, here’s how to pipe through your LinkShare link to the app.

    http://www.alexcurylo.com/blog/2009/03/06/snippet-app-store-links/

  3. Ivan Kalaica

    Your welcome!

  4. Ivan Kalaica

    Interesting post Alex. :-)

  5. Carol

    From within my app… how would I jump directly to “all apps by this author”?

  6. Karuna

    When I do right-click on my items in iTunes I am getting only “Open Link and Copy Link” but not “Copy iTunes Store Link”. So can you tell me how do i get the correct URL to launch app store from my application.
    Thanks in advance.

    Regards,
    V.Karuna.

  7. Ketan

    @Karuna

    if you don’t see “Copy iTunes Store Link” then use “Copy Link” .

    There is one Id in this link.
    just replace that id(301349397) in following link. It works only in device.

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301349397&;amp;amp;amp;amp;mt=8"]];

  8. Robert Wohnoutka

    Any answer to:
    From within my app… how would I jump directly to “all apps by this author”?

  9. hi, i’m experimenting with qr codes, and was wondering if there was a way use qr code to activate an iphone code… in other words, can i write a qr code that opens the app store (or another installed app) when scanned? this is my first foray into iphone coding, and welcome any help.

  10. when i click on the button that is supposed to send me to the app store the application just closes. I have looked at tons of websites and can’t figure out what i’m missing. I was getting an error until I added URL Types to my info Plist, but on all examples no one has this. Is there something in the info plist, or a framework, or something else you need?

  11. Francesco

    Hi

    thanks for the helpful information. I want to add a box that bring the user to the app store directly into the space to review/rate and app. How should I do that?

    Thank again for your support.
    Francesco

  12. ramesh

    Hi,i built an small application for iphone, I have provisional certificate too. I want to launch application. So plz can anybody tell me the procedure to launch. Is i need to take one more certificate to launch (business perpose)?

  13. Great Post Al

  14. Erika

    Hi,
    Does anyone use the Bill Tracker for iPhone application?
    This is a great application to track your bills but I don’t know how to backup this application or store data on eg. email account file.
    Can anyone help please?
    Thank you!

  15. keli

    I used “Copy Link” and got the link and repaced itunes by phobos but i am getting alert “Cannot connect to itunnes Store” on device.

    Will it work in US?

    And how can i get rid of from this alert – “Cannot connet to itunes.”

    Thanks

  16. Matias

    Im just copy the link from itunes and paste it on a qr generator page that create a qr image from the text. Next, with my iphone i scanned it and it took me to the appstore. Only just copy/paste the url,dont replace the itunes with phobos.

  17. Anthony

    What if your app is international and you want it to open to the app store page for the user’s country…

    If you copied the URL from itunes and your itunes was set to USA store, then users in different countries would be viewing the app in the USA store :(

    There must be a way to have the app store open for thier country.. anyone know any details on this?

  18. joy

    Thanks for this site! It was very helpful to me to launch the store apps in my Iphone . I made it very successfully. Thank you so much!

    Best iPhone Apps

  19. May

    Erm..My iPhone has no App Store icon so I cant download any app. Is there any way for me to download apps to my iPhone?

  20. joel

    My iPhone has no App Store icon so I cant download any app. Is there any way for me to download apps to my iPhone?

  21. thijsjan meindertsma

    hi, i think your solution is now obsolete. The itunes.apple.com link works fine on iOS 5.1

    KR, TJ

  22. Kish

    iTunes link is not opening in iPhone , gives error “Your request could not be completed” …but the same link opens iTunes on iPad

  23. Joe

    @ Kish

    I tunes Link will not open directly in I Phone Safari, You need to generate a new Link using I Tunes Link Maker

    http://itunes.apple.com/linkmaker/

    It may not work in Emulator but you can open in you device.

  24. Alfredo

    Hey there just wanted to give you a brief heads up
    and let you know a few of the images aren’t loading correctly. I’m
    not sure why but I think its a linking issue.
    I’ve tried it in two different browsers and both show the same results.

  25. Superb post but I was wanting to know if you could write a litte more on
    this topic? I’d be very thankful if you could elaborate a little bit more. Appreciate it!

  26. Arash

    Nice, but you can also use bellow code: [[UIApplication
    sharedApplication] openURL:[NSURL
    URLWithString:@"itms-apps://itunes.com/apps/appname"]]; and you
    will see, the appstore app wil open.

Add Your Comment

Please wrap all source codes with [code][/code] tags.
Top