Easily integrate Autonomous Single App Mode in your ios app, allowing it to control Single App Mode sessions for focused, distraction-free user experiences. Ideal for educational, testing, or kiosk applications.
npm install capacitor-plugin-asam
npx cap sync
To enable the Autonomous Single App Mode (ASAM) on iOS devices, administrators must utilize a Mobile Device Management (MDM) system or Apple Configurator.
These tools are essential for setting up and managing ASAM, as they provide the ability to create and deploy specific configuration profiles to iOS devices.
These profiles dictate which applications can run in ASAM, ensuring controlled and secure usage of the devices in environments like schools, businesses, or public kiosks. Without MDM or Apple Configurator, activating ASAM on iOS devices is not feasible.
// import the plugin
import {Asam} from "capacitor-plugin-asam";
// --------------------
// enable ASAM using setASAM
let r = await Asam.setASAM({enable: true});
if (!r.success)
console.error("Failed to enable ASAM");
let isEnabled = (await Asam.isASAMEnabled()).enabled;
console.log("ASAM is enabled: " + isEnabled);
// --------------------
// another way to enable ASAM using enableASAM
r = await Asam.enableASAM();
if (!r.success)
console.error("Failed to enable ASAM");
isEnabled = (await Asam.isASAMEnabled()).enabled;
console.log("ASAM is enabled: " + isEnabled);
// --------------------
// disable ASAM using disableASAM
r = await Asam.disableASAM();
if (!r.success)
console.error("Failed to disable ASAM");
isEnabled = (await Asam.isASAMEnabled()).enabled;
console.log("ASAM is enabled: " + isEnabled);
// --------------------
// another way to disable ASAM using setASAM
r = await Asam.setASAM({enable: false});
if (!r.success)
console.error("Failed to disable ASAM");
setASAM(options: { enable: boolean; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ enable: boolean; } |
Returns: Promise<{ success: boolean; }>
enableASAM() => Promise<{ success: boolean; }>
Returns: Promise<{ success: boolean; }>
disableASAM() => Promise<{ success: boolean; }>
Returns: Promise<{ success: boolean; }>
isASAMEnabled() => Promise<{ enabled: boolean; }>
Returns: Promise<{ enabled: boolean; }>
enableASAM(): Promise<{ success: boolean }>;
Enable Autonomous Single App Mode (ASAM) on the device.
Returns: Promise<{ success: boolean; }>
disableASAM(): Promise<{ success: boolean }>;
Disable Autonomous Single App Mode (ASAM) on the device.
Returns: Promise<{ success: boolean; }>
isASAMEnabled(): Promise<{ enabled: boolean }>;
Returns whether Autonomous Single App Mode (ASAM) is enabled on the device.
Returns: Promise<{ enabled: boolean; }>