简体   繁体   English

如何在iOS应用程序的锁定屏幕中添加按钮或可点击的文本?

[英]How to add buttons or clickable text to the lock screen in an iOS app?

I am developing an iOS app and one requirement of the app is that the user has to be able to interact with the app through buttons or clickable text on the lock screen. 我正在开发一个iOS应用程序,该应用程序的一个要求是用户必须能够通过锁定屏幕上的按钮或可单击的文本与该应用程序进行交互。 A minimum of 5 and a maximum of 8 buttons are to be shown to the user on the lock screen. 锁定屏幕上将向用户显示最少5个按钮,最多8个按钮。

Please suggest what I can use to add this feature to the application. 请提出我可以用来将该功能添加到应用程序中的内容。

Unfortunately, you cannot add controls of any kind to the lock screen in iOS. 不幸的是,您无法在iOS的锁定屏幕中添加任何类型的控件。 However, one option that might work for you is a today extension. 但是,今天的扩展可能是最适合您的选择。 Today extensions are accessible from the lock screen if enabled by the user. 如果用户启用了扩展,则今天可以从锁定屏幕访问这些扩展。

Apple Docs on Today Extension: 今日扩展程序上的Apple文档:

https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Today.html https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Today.html

Here's a good tutorial on how to build a Today Extension: 这是有关如何构建Today Extension的很好的教程:

https://www.raywenderlich.com/150953/today-extension-tutorial-getting-started https://www.raywenderlich.com/150953/today-extension-tutorial-getting-started

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

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