Last active
December 27, 2015 05:59
-
-
Save TachibanaKaoru/7278793 to your computer and use it in GitHub Desktop.
catch notification from iPod player.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (link MediaPlayer.framework) | |
// get item changed notification | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changePlayerStatus:) name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification object:nil]; | |
// get status changed notification | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changePlayerStatus:) name:MPMusicPlayerControllerPlaybackStateDidChangeNotification object:nil]; | |
// get volume changed notification | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changePlayerStatus:) name:MPMusicPlayerControllerVolumeDidChangeNotification object:nil]; | |
[[MPMusicPlayerController iPodMusicPlayer] beginGeneratingPlaybackNotifications]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment