Is it possible to turn Single App Mode off/on programtically?

I'm trying to build an app that will go into single app mode when I open the app. The app will have a submit button. Until this submit button is clicked, they will still be in single app mode. After clicking the submit button, the single app mode will be closed.

Is this possible to do?

Answered by Frameworks Engineer in 690512022

This sounds very possible by using the requestGuidedAccessSession(enabled:completionHandler:) API on UIAccessibility.

You can use this method to lock your app into Single App mode and to release it from that mode later. For example, a test-taking app might enter this mode at the beginning of a test and exit it when the user completes the test. Entering Single App mode is supported only for devices that are supervised using Mobile Device Management (MDM), and the app itself must be enabled for this mode by MDM. You must balance each call to enter Single App mode with a call to exit that mode.

Check it out here: https://developer.apple.com/documentation/uikit/uiaccessibility/1615186-requestguidedaccesssession

What platform... macOS, iOS, iPadOS, tvOS?

Accepted Answer

This sounds very possible by using the requestGuidedAccessSession(enabled:completionHandler:) API on UIAccessibility.

You can use this method to lock your app into Single App mode and to release it from that mode later. For example, a test-taking app might enter this mode at the beginning of a test and exit it when the user completes the test. Entering Single App mode is supported only for devices that are supervised using Mobile Device Management (MDM), and the app itself must be enabled for this mode by MDM. You must balance each call to enter Single App mode with a call to exit that mode.

Check it out here: https://developer.apple.com/documentation/uikit/uiaccessibility/1615186-requestguidedaccesssession

on iOS

Is it possible to turn Single App Mode off/on programtically?
 
 
Q