Rob Bonner
Rob Bonner

Reputation: 9426

iphone access to song database/stats

Can an app that you develop interface with iTunes on the iPhone/iPod to get a name of a song or a list of the songs that are played the most by the owner of the iPhone or iPod?

Upvotes: 0

Views: 424

Answers (2)

abarrington
abarrington

Reputation: 166

This has changed with the introduction of User-Defined Property Keys.

Refer to this question: ios get play count for items in the media library

Upvotes: 0

Shaggy Frog
Shaggy Frog

Reputation: 27601

Using the Media Player Framework, what information you can get about any particular song is limited to the MPMediaItemProperty values that Apple exposes. The General Media Item Property Keys are as follows:

NSString *const MPMediaItemPropertyPersistentID;      // filterable
NSString *const MPMediaItemPropertyMediaType;         // filterable
NSString *const MPMediaItemPropertyTitle;             // filterable
NSString *const MPMediaItemPropertyAlbumTitle;        // filterable
NSString *const MPMediaItemPropertyArtist;            // filterable
NSString *const MPMediaItemPropertyAlbumArtist;       // filterable
NSString *const MPMediaItemPropertyGenre;             // filterable
NSString *const MPMediaItemPropertyComposer;          // filterable
NSString *const MPMediaItemPropertyPlaybackDuration;
NSString *const MPMediaItemPropertyAlbumTrackNumber;
NSString *const MPMediaItemPropertyAlbumTrackCount;
NSString *const MPMediaItemPropertyDiscNumber;
NSString *const MPMediaItemPropertyDiscCount;
NSString *const MPMediaItemPropertyArtwork;
NSString *const MPMediaItemPropertyLyrics;
NSString *const MPMediaItemPropertyIsCompilation;     // filterable
NSString *const MPMediaItemPropertyReleaseDate;
NSString *const MPMediaItemPropertyBeatsPerMinute;
NSString *const MPMediaItemPropertyComments;
NSString *const MPMediaItemPropertyAssetURL;

As you can see, play count (or something similar) is not listed there, so the answer is "no".

Upvotes: 2

Related Questions