2

音楽の再生中にロック画面とコマンド センターでコントロール ボタンが無効になるのはなぜですか? MPRemoteCommandCenter を使用して、リモート経由でアクセスを制御します。私を助けてください,tx どうも。

ところで

  1. アプリは強制終了されませんでした。
  2. アプリのインタースティシャル 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:)];
}
4

0 に答える 0