繁体   English   中英

从iOS锁定屏幕在应用程序中自定义远程事件处理

[英]Custom remote event handling in app from iOS lock screen

spotify如何处理自定义远程事件? 目前在运行iOS 8.1.3的iPhone 6和Spotify版本2.4.0.1822上,当我打开spotify无线电时,我在锁定屏幕上获得以下控件。 我已经尝试阅读所有与远程事件有关的文档,我无法找到任何允许来自锁定屏幕的自定义远程事件的资源。

在此输入图像描述在此输入图像描述

也许这是通过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。 您可能会看到自定义锁定屏幕。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM