简体   繁体   English

可从iOS中的锁定屏幕访问按钮

[英]Button accesible from lock screen in iOS

I want to develop an iOS app that can have like a panic button when the screen is locked. 我想开发一个iOS应用,当屏幕锁定时,它可以像紧急按钮一样。 This button can be enable or disabled within the app, but I want to know if it is possible to add a very accessible button you can press in case of an emergency even when the screen is locked. 可以在应用程序中启用或禁用此按钮,但是我想知道是否可以添加一个非常易于访问的按钮,即使在屏幕锁定时,在紧急情况下也可以按下该按钮。 When the button is pressed I want to execute some code in the app. 当按下按钮时,我想在应用程序中执行一些代码。

Is there a possible way of accomplishing this in iOS? 有没有可能在iOS中完成此操作?

Or is there an alternative?, The only think that I required is that the button can be pressed like in maximum three seconds even if the screen is locked and the app closed. 还是有其他选择?,我唯一需要的是即使屏幕被锁定且应用程序关闭,也可以最多在三秒钟内按下按钮。

No that is not possible in iOS. 不行,这在iOS中是不可能的。 You cannot make changes outside of your app. 您无法在应用之外进行更改。

One suggestion i can give you is to make a extension for today view in notification center. 我可以给您的一个建议是对通知中心的“今天”视图进行扩展。 And you can ask the users to touch the button in notification center to invoke your functionality. 您可以要求用户触摸通知中心中的按钮以调用您的功能。

Notification center can be accessed in lock screen also. 通知中心也可以在锁定屏幕中访问。

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

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