Skip to content

Easily integrate Autonomous Single App Mode in your app, allowing it to control Single App Mode sessions for focused, distraction-free user experiences. Ideal for educational, testing, or kiosk applications.

License

Notifications You must be signed in to change notification settings

dimer47/capacitor-plugin-asam

Repository files navigation

Capacitor Plugin ASAM (Autonomous Single App Mode)

Release : 1.0.1 Last update Dependency size Repo size Downloads License

⚠️ Only for iOS devices

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.

📍 Install

npm install capacitor-plugin-asam
npx cap sync

⚙️ Configuration

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.

🕹️ Usage

// 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");

🧮 API

setASAM(...)

setASAM(options: { enable: boolean; }) => Promise<{ success: boolean; }>
Param Type
options { enable: boolean; }

Returns: Promise<{ success: boolean; }>


enableASAM()

enableASAM() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


disableASAM()

disableASAM() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


isASAMEnabled()

isASAMEnabled() => Promise<{ enabled: boolean; }>

Returns: Promise<{ enabled: boolean; }>


enableASAM()

enableASAM(): Promise<{ success: boolean }>;

Enable Autonomous Single App Mode (ASAM) on the device.

Returns: Promise<{ success: boolean; }>


disableASAM()

disableASAM(): Promise<{ success: boolean }>;

Disable Autonomous Single App Mode (ASAM) on the device.

Returns: Promise<{ success: boolean; }>


isASAMEnabled()

isASAMEnabled(): Promise<{ enabled: boolean }>;

Returns whether Autonomous Single App Mode (ASAM) is enabled on the device.

Returns: Promise<{ enabled: boolean; }>


About

Easily integrate Autonomous Single App Mode in your app, allowing it to control Single App Mode sessions for focused, distraction-free user experiences. Ideal for educational, testing, or kiosk applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published