views:

812

answers:

2

Is it possible to open the App Store app from within my app and run a search?

I'm looking to see if there's an appstore:// type URL that I could use, in the same way that mailto: and sms: open Mail and SMS respectively.

Does anyone know if this is possible?

Edit - more info:

I've been trying using UIApplication's openURL: method, passing various forms of phobos and iTunes URLs, with no luck so far.

Some may be aware that you can right-click links in iTunes on the desktop and copy links to certain pages. I copied the link to a page that listed all the apps for a particular company.

Some may also be aware that you can do a search in the App Store app on the iPhone for a company name and the search results will be all the apps owned by that company.

I'm trying to achieve that via a link from my app...

Using the link copied from iTunes on the desktop simply opens Safari, and then opens the iTunes app, and finally ends with a "Cannot connect to iTunes Store" message. This is regardless of whether or not the URL starts with phobos or itunes.

Here is the link I've been trying to use (ID trimmed)

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=someId

Any ideas would be awesome, thanks.

+1  A: 

To open iTunes or the AppStore from your application you need to
use the prefix itms://

Then you can search for artists via an URL like this:

itms://phobos.apple.com/WebObject/MZStore.woa/wa/viewArtist?id=someId

Or you can tell AppStore to open up and show a specific app like this:

itms://phobos.apple.com/WebObject/MZStore.woa/wa/viewSoftware?id=someId

The real difference ist just what you wan't to view and the itms:// prefix instead of http.
E.g. using the viewSoftware-Version with id=315316036 will open AppStore
and display Rowmote Pro (random pick, I was just surfing AppStore..).

UPDATE

It looks like it's a little trickier to link to artists and search results than it is
for applications or albums (which both worked in my tests).

I came across this technical Q&A from Apple which states that for some links to work multiple redirects are needed. This could be the point on which iTMS bails out..
(and you don't seem to be the only one with this problem, see here or here).

Shirkrin
Thanks for the answer, but it doesn't seem to work. What I'm seeing is that even with the itms:// prefix, it still opens the iTunes store and gives me an error instead of opening the App Store...
Jasarien
I did some research and updated my answer.
Shirkrin
Yeah I was aware of that document, I used when figuring out how to process affiliate links. There still doesn't seem to be any way of running an arbitrary search or just showing all apps from a particular company though... :(
Jasarien
+1  A: 

Erika Sadun explains how to build an App Store search link here.

Raymond