简体   繁体   中英

Open iTunes Store from iOS app

I have an app that plays music and I need to implement iTunes search. So, for example, I need to find song by Pink Floyd called Time. How can I open iTunes Store on iOS with results of search query "Pink Floyd - Time"? I know it's possible, since there is an app in App Store, called VK App, a client for social network that does exactly that.

And do I need to somehow request approval of this function by Apple?

Apple has a link maker designed to do just that.

Here's the link to it .

For loading dynamically you can use like this example, it will open the itunes store with the searched item: @"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?artistTerm=pink%20floyd&songTerm=High%20Hopes"

Also, you can perform a search and parse the result (a json) to provide a more specific link using this web service:

https://itunes.apple.com/search?term=pink+floyd%20high%20hopes

Here is the link for the API: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html

I am using the second approach on one of my app's. Works good

Wish it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM