Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtaining iTunes ID to an iPod player item

I have an app that interacts with both the iPod player, and the iTunes Store Web Service Search API. Is there a way to obtain the iTunes ID for a song that I retrieve from my user's iPod library (e.g. via MPMusicPlayerController, or MPMediaItem)?

The documentation says that the MPMediaItemPropertyPersistentID is a unique identifier that persists across app launch. This however, seems like it might be a unique local id.

The only solution I can think of is to retrieve the song title and artist from MPMediaItem, then query iTunes to obtain the iTunes ID. Is the iTunes ID stored anywhere locally within the iPod library?

Thanks - I am pretty new to the media framework.

like image 337
twinkle Avatar asked Dec 31 '09 01:12

twinkle


1 Answers

The API documentation does not list a property for MPMediaItem that gives the iTunes Song ID, but it does give all of the information about a song such as the Artist and song name so, as you suggested, you could search the store for that criteria.

like image 80
Alex Stuckey Avatar answered Oct 22 '22 06:10

Alex Stuckey