简体   繁体   English

iPhone屏幕锁

[英]Iphone Screen Lock

I'm not too familiar with Iphone development, but I am trying to create an App that can lock the screen and prevent the user from using the phone under certain conditions. 我对Iphone的开发不太熟悉,但是我试图创建一个可以锁定屏幕并阻止用户在某些情况下使用手机的应用程序。

I have been told before that it is impossible for this type of functionality to exist in an Iphone, but I know there is an app called Cell Control that does something similar. 之前有人告诉我,这种功能不可能存在于Iphone中,但是我知道有一个名为Cell Control的应用程序可以执行类似的操作。 I am trying to figure out how to create this type of functionality. 我试图弄清楚如何创建这种类型的功能。

My research has led me to MDM solutions that was introduced in IOS4. 我的研究使我找到了IOS4中引入的MDM解决方案。 This link was very helpful: http://flicksoftware.com/2010/08/mobile-it-guide-to-iphone-deployment-and-management-with-apples-ios-4/ 该链接非常有帮助: http : //flicksoftware.com/2010/08/mobile-it-guide-to-iphone-deployment-and-management-with-apples-ios-4/

My question is how would one go about implementing a lock screen functionality in an Iphone app. 我的问题是,如何在Iphone应用程序中实现锁屏功能。 Is it using some implementation of the MDM solution, or doing something else entirely? 是使用MDM解决方案的某种实现方式,还是完全执行其他操作?

The iOS SDK doesn't provide a way to do this from an app. iOS SDK没有提供从应用程序执行此操作的方法。 The device can be locked into a particular app using Guided Access and probably using an MDM feature as you describe, but that has to be activated manually by the user (or the administrator in the MDM case) and is not under the app's control. 可以使用Guided Access并可能使用您所描述的MDM功能将设备锁定到特定的应用程序中,但是必须由用户(或MDM情况下的管理员)手动激活,并且不受应用程序的控制。

Combining Albert and Noah answers and adding some more details. 结合Albert和Noah的答案,并添加更多详细信息。

1) iOS public API doesn't have anything which will allow you to do that. 1)iOS公共API没有任何可让您做到这一点的东西。 You can use private api's to do that. 您可以使用私有api来做到这一点。 However, you won't be able to distribute such application through AppSotre. 但是,您将无法通过AppSotre分发此类应用程序。 Also, you have ability to sign it with enterprise certificate and distribute it in your compan. 此外,您还可以使用企业证书进行签名并将其分发到公司中。

Also, you can provide such functionality on jailbroken iOS device and sell it through Cydia . 另外,您可以在越狱的 iOS设备上提供此类功能,然后通过Cydia出售。

2) Noah correctly pointed out that you can use guided mode to prevent iOS device from switching to another apps. 2)诺亚正确指出,您可以使用引导模式来防止iOS设备切换到其他应用。 However, there are gotchas. 但是,有陷阱。 iOS device can be managed only by one MDM server. iOS设备只能由一台MDM服务器管理。 So, a device will have to be managed by your MDM server (and it won't work if a user has 3rd party MDM installed on your device). 因此,设备将必须由您的MDM服务器进行管理(如果用户在您的设备上安装了第三方MDM,则该设备将无法工作)。

There are couple of open source MDM server (which are good start to look into it): 有几个开源MDM服务器(这是研究它的一个很好的开始):

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

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