Programmatically run a search on the App Store?

后端 未结 2 1010
春和景丽
春和景丽 2021-02-09 18:39

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 t

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-09 19:01

    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).

提交回复
热议问题