ios - 以编程方式启用/禁用引导访问-c?

标签 ios objective-c iphone

我正在尝试从我的应用程序启用/禁用引导式访问。

这是我的代码:

NSLog(@"requesting guided access");
UIAccessibilityRequestGuidedAccessSession(YES, ^(BOOL didSucceed) {
    if (didSucceed) {
        NSLog(@"entered guided access");
    }
    else {
        NSLog(@"failed to enter guided access");
    }
});

总是得到 没有成功=否

不知道是什么问题

还有什么事情要做吗?

我需要 MDM 配置文件或其他任何东西吗???

提前致谢

最佳答案

这就是启用单应用程序模式的方式。但是,要做到这一点,设备必须受到监督,并且安装了 MDM 配置文件,该配置文件在可以请求引导访问模式的应用程序列表中具有应用程序的捆绑 ID, key 是 autonomousSingleAppModePermittedAppIDs .

https://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html

https://developer.apple.com/library/mac/documentation/AppKit/Reference/NSAccessibility_Protocol_Reference/

关于ios - 以编程方式启用/禁用引导访问-c?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35151781/

相关文章:

ios - 在运行时获取特定 CocoaPods 版本的最佳方法是什么?

ios - 呈现一个新的 View Controller 保持标签栏

ios - 修复了空格键按钮项目将按钮放置在屏幕之外的问题

ios - OCUnit的测试用例类中是否需要在public接口(interface)中定义测试方法

iphone - 在 iOS sdk 中实现 adColony 时出错

iphone - 为什么会出现过度释放呢? UINavigationController/UITableview

ios - NSMutableArray 保存所有 View 的所有值

ios - 越狱设备上的正常iOS开发

iphone - 无法检测 EKEventEditViewController 中的崩溃

iphone - 如何从模态视图推送 UIViewController