Discussion
The dictionary passed in is suitable
for assignment to [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo
and may contain data for the following keys:
- MPMediaItemPropertyAlbumTitle
- MPMediaItemPropertyArtist
- MPMediaItemPropertyTitle
- MPMediaItemPropertyPlaybackDuration
- MPNowPlayingInfoPropertyElapsedPlaybackTime
- MPNowPlayingInfoPropertyPlaybackRate
- MPMediaItemPropertyArtwork
note that these keys may be missing if no song is playing
NOTE all apps powered by the Feed.fm SDK must display song
title, artist, and album information on the lock screen, per
our music licenses.
To exactly duplicate the default handling of the MPNowPlayingInfoCenter
data by the Feedfm SDK, you would implement this method as:
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo = info;
MPRemoteCommandCenter *rcc = [MPRemoteCommandCenter sharedCommandCenter];
MPRemoteCommand *nextTrackCommand = [rcc nextTrackCommand];
MPFeedbackCommand *dislikeCommand = [rcc dislikeCommand];
MPFeedbackCommand *likeCommand = [rcc likeCommand];
if ([info objectForKey:MPMediaItemPropertyTitle] != NULL) {
[nextTrackCommand setEnabled: nextTrackEnabled];
[dislikeCommand setEnabled:YES];
[dislikeCommand setActive:dislikeActive];
[likeCommand setEnabled:YES];
[likeCommand setActive:likeActive];
} else {
[nextTrackCommand setEnabled: NO];
[dislikeCommand setEnabled:NO];
[likeCommand setEnabled:NO];
}