Why dos the control button disable on lock screen and command center when playing Music? I use MPRemoteCommandCenter to control the access via remote. Please help me,tx very much.
Btw
- The app was not killed.
- I add admob SDK as my app Interstitial AD.
control button disable on command center
control button disable on lock screen
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.1) {
MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
commandCenter.playCommand.enabled = YES;
[commandCenter.playCommand addTarget:self action:@selector(playAction:)];
[commandCenter.pauseCommand addTarget:self action:@selector(pauseAction:)];
commandCenter.previousTrackCommand.enabled = YES;
[commandCenter.previousTrackCommand addTarget:self action:@selector(previousTrackAction:)];
commandCenter.nextTrackCommand.enabled = YES;
[commandCenter.nextTrackCommand addTarget:self action:@selector(nextTrackAction:)];
commandCenter.togglePlayPauseCommand.enabled = YES;
[commandCenter.togglePlayPauseCommand addTarget:self action:@selector(playOrPauseAction:)];
}