I realize this question has been asked before, but I have all the same code as other answers (so I think). The pictures and images show up fine and update while a new song becomes current song. I just can't seem to get the play/pause and skip buttons working. This is the code him using.
-(void)viewWillAppear:(bool)animated
{
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
}
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:YES];
[[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[self resignFirstResponder];
}
-(BOOL)canBecomeFirstResponder
{
return YES;
}
-(void)remoteControlReceivedWithEvent:(UIEvent *)event
{
if (event.type == UIEventTypeRemoteControl) {
switch (event.subtype) {
case UIEventSubtypeRemoteControlTogglePlayPause:[self playPauseButtonPressed:nil];
NSLog(@"play pause button remote pressed");
break;
case UIEventSubtypeRemoteControlBeginSeekingForward:[self skipButtonPressed:nil];
NSLog(@"Skip remote pressed");
break;
default: break;
}
}
}