startKioskMode function
Requests the platform to restrict the current user to the app.
Returns true
, if platform satisfied the request successfully, false
- otherwise.
On Android, Activity.startLockTask is called.
On iOS, UIAccessibility.requestGuidedAccessSession is called.
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. Otherwise the result will always be false
.
Implementation
// ignore: prefer-boolean-prefixes, a valid name with bool result
Future<bool> startKioskMode() => _channel
.invokeMethod<bool>('startKioskMode')
.then((didStartKioskMode) => didStartKioskMode ?? false);