gpt4 book ai didi

ios - 获取点击事件锁屏控件(MPRemoteCommandCenter)

转载 作者:行者123 更新时间:2023-11-28 05:45:28 27 4
gpt4 key购买 nike

我已经实现了播放音频的 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
}

但我想检测用户何时从锁定屏幕点击音乐标题或 Logo 或播放器。它打开我们的应用程序。有可能得到吗?

我想在用户从锁定屏幕点击音乐播放器时打开一个 Controller 。

最佳答案

当您的应用程序被激活时,您可以做出响应,但无法得知它已被激活,因为用户在锁定屏幕中点击了音乐播放器。

关于ios - 获取点击事件锁屏控件(MPRemoteCommandCenter),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54925590/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com