Spotify如何处理自定义远程事件?目前在运行iOS 8.1.3和Spotify版本2.4.0.1822的iPhone 6上,当我打开Spotify电台时,锁屏界面会显示以下控件。我尝试阅读所有有关远程事件的文档,但无法找到任何允许从锁屏界面发送自定义远程事件的资源。
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。您可能会看到一个定制的锁屏。
注意 - 菜单可以自定义标签,但无法自定义图标图像和行数。