Thanks for noticing this question. I want to do something about music recommendation, and what I am doing now is leveraging MPNowPlayingInfoCenter
's nowPlayingInfo
, like this:
NSDictionary *metaData = [[MPNowPlayingInfoCenter defaultCenter] nowPlayingInfo];
NSString *songTitle = metaData[MPMediaItemPropertyTitle];
NSString *albumnTitle = metaData[MPMediaItemPropertyAlbumTitle];
NSString *artist = metaData[MPMediaItemPropertyArtist];
But it always returns nil when "Music" app is playing music in background. I looked up the related documents, it says
MPNowPlayingInfoCenter provides an interface for setting the current now
playing information for the application.
The default center holds now playing info about the current application
Seems there is no way to get other app's nowPlayingInfo
through MPNowPlayingInfoCenter
. So are there any other ways to get other app's music meta data displayed in remote control/lock screen? Thanks!