MPRemoteCommandCenter远程命令无法正常工作

时间:2015-10-24 19:41:30

标签: ios swift avplayer

我实现了一个可以在后台播放音频的音频播放器。因此,我想对播放/暂停等远程控制命令作出反应。我按照示例创建了this code (see Gist)

但是,当我单击控制中心或锁定屏幕中的暂停按钮时,不会调用链接的动作功能。

我使用this as example code,当然还有Apple documentation

  • UIApplication.sharedApplication().beginReceivingRemoteControlEvents()已完成
  • AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)进行
  • AVAudioSession.sharedInstance().setActive(true)已完成
  • 背景模式在Info.plist中启用音频/视频
  • setting up the command actions已完成

我错过了什么?

0 个答案:

没有答案