Spotify如何处理自定义远程事件?当前在运行iOS 8.1.3和Spotify版本2.4.0.1822的iPhone 6上,当我打开Spotify radio 时,在锁定屏幕上获得以下控件。香港专业教育学院试图阅读有关远程事件的所有文档,但我找不到从锁定屏幕允许自定义远程事件的任何资源。

最佳答案

也许可以通过MPRemoteCommandCenter实现。
这是例子

MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
[[remoteCommandCenter skipForwardCommand] addTarget:self action:@selector(skipForward)];
[[remoteCommandCenter togglePlayPauseCommand] addTarget:self action:@selector(togglePlayPause)];
[[remoteCommandCenter pauseCommand] addTarget:self action:@selector(pause)];
[[remoteCommandCenter likeCommand] addTarget:self action:@selector(like)];

实现此代码,在您的应用上播放音乐,然后锁定iPhone。您可能会看到自定义的锁定屏幕。

注意-菜单可以自定义标签,但不能自定义图标图像和行数。

关于ios - 通过iOS锁定屏幕在应用程序中自定义远程事件处理,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28677791/

10-09 02:32