如何在iPhone上以编程方式启用Guided Access(Kiosk模式)?

如何在iPhone上以编程方式启用Guided Access(Kiosk模式)?

问题描述:

问题

如何自动 iPhone上的Guided Access 模式?我需要自动启用和删除此功能

How do I automate Guided Access mode on an iPhone? I will need to automate the enabling and removal of this feature

背景
来自爱荷华州的此应用程序使用iOS应用程序显示您的驾照。问题是,在将手机交给当局后,他们可以完全访问该设备。

Background This application from the State of Iowa uses an iOS app to display your drivers license. The issue is that after handing your phone over to authorities, they have full access to the device.

如果我有这个或类似的应用程序的源代码,我可以在切换出临时Kiosk模式时需要密码,这样手机或(理想情况下)无法通过USB提供照片,电子邮件或短信。

If I have the source code to this, or a similar application, how can I require a password when switching out of temporary "Kiosk mode", so that photos, emails or text messages are not available from either the phone, or (ideally) from USB.

我发现了类似的 Android解决方案,但现在正在寻找iOS解决方案

I found this similar solution for Android, but am now looking for an iOS solution

您可以在应用程序中输入和退出指导访问模式。但是,为此,必须对设备进行监督,并安装MDM配置文件,该应用程序的捆绑ID在可以请求引导访问模式的应用程序列表中(密钥为 autonomousSingleAppModePermittedAppIDs

You can enter and exit guided access mode from within your app. However, to do so the device has to be supervised, and have an MDM profile installed that has the app's bundle ID in the list of applications that can request guided access mode (the key is autonomousSingleAppModePermittedAppIDs.

完成后,要输入指导访问权限,请执行以下操作:

Once that is done, to enter guided access you do this:

UIAccessibilityRequestGuidedAccessSession(true){
    success in
    println("Request guided access success \(success)")
}