【发布时间】:2019-02-28 12:19:05
【问题描述】:
我已经实现了用于播放音频的 Avplayer。我已经使用 MPRemoteCommandCenter 来访问锁定屏幕。我可以通过以下方式获得所有访问权限:
let commandCenter = MPRemoteCommandCenter.shared()
commandCenter.pauseCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in
//Update your button here for the pause command
return .success
}
commandCenter.playCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in
//Update your button here for the play command
return .success
}
但我想检测用户何时从锁定屏幕点击音乐标题或徽标或播放器。它打开了我们的应用程序。有可能得到吗?
当用户从锁定屏幕点击音乐播放器时,我想打开一个控制器。
【问题讨论】:
-
我也有同样的问题!
标签: ios swift lockscreen mpremotecommandcenter