0

我正在尝试使用“Meraki”MDM 为我的一个应用程序设置单一应用程序模式,在 MDM 站点上注册了设备并创建了配置文件。

我正在使用本网站建议的以下代码,该代码在模拟器上运行良好,但在 iPad 上运行良好。“UIAccessibilityRequestGuidedAccessSession”未触发。有人可以帮助我在这里缺少什么。

NSLog(@"requesting guided access");
UIAccessibilityRequestGuidedAccessSession(YES, ^(BOOL didSucceed) {
    if (didSucceed) {
        NSLog(@"entered guided access");
        self.inGuidedSessionMode = YES;
        [[[UIAlertView alloc] initWithTitle:@"entered single access mode" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
    }
    else {
        NSLog(@"failed to enter guided access");
        [[[UIAlertView alloc] initWithTitle:@"Unable to enter single access mode" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
    }
});
4

1 回答 1

1

这仅在设备受到监督时才有效,这是通过 Apple Configurator 或 Apple Device Enrollment Program 完成的。

于 2015-03-20T16:35:11.793 回答