音楽の再生中にロック画面とコマンド センターでコントロール ボタンが無効になるのはなぜですか? MPRemoteCommandCenter を使用して、リモート経由でアクセスを制御します。私を助けてください,tx どうも。
ところで
- アプリは強制終了されませんでした。
- アプリのインタースティシャル AD として admob SDK を追加します。
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:)];
}