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/