Skip to main content
@capgo/capacitor-alarm Device APIs Open source

Alarm Capacitor plugin

Schedule native alarms and notifications even when app is closed

Install

bun add @capgo/capacitor-alarm bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-alarm
  • pnpm add @capgo/capacitor-alarm
  • yarn add @capgo/capacitor-alarm

Guide

How to use Alarm in Capacitor

Using @capgo/capacitor-alarm

Capacitor Alarm Plugin interface for managing native OS alarms.

Install

bun add @capgo/capacitor-alarm
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { CapgoAlarm } from '@capgo/capacitor-alarm';

API at a glance

Method Description
createAlarm Create a native OS alarm using the platform clock app. On Android this uses the Alarm Clock intent; on iOS this uses AlarmKit if available (iOS 16+).
openAlarms Open the platform's native alarm list UI, if available.
getOSInfo Get information about the OS and capabilities.
requestPermissions Request relevant permissions for alarm usage on the platform. On Android, may route to settings for exact alarms.
checkPermissions Check the current permission state for native alarm access without triggering UI. On iOS this reports AlarmKit readiness; on Android it reports capability details.
getAlarms Get a list of alarms scheduled by this app. On iOS 26+, returns alarms from AlarmKit. On Android, this is not supported as the system does not provide an API to query alarms.
cancelAlarm Cancel a scheduled alarm by its ID. On iOS 26+, removes the alarm from AlarmKit. On Android/web, returns not supported.

Examples

createAlarm()

Create a native OS alarm using the platform clock app. On Android this uses the Alarm Clock intent; on iOS this uses AlarmKit if available (iOS 16+).

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const result = await CapgoAlarm.createAlarm({
  hour: 7,
  minute: 30,
  label: 'Wake up',
  skipUi: false,
  vibrate: true
});
console.log('Alarm created:', result.success);

openAlarms()

Open the platform's native alarm list UI, if available.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const result = await CapgoAlarm.openAlarms();
if (result.success) {
  console.log('Alarms UI opened');
}

getOSInfo()

Get information about the OS and capabilities.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const info = await CapgoAlarm.getOSInfo();
console.log('Platform:', info.platform);
console.log('Supports native alarms:', info.supportsNativeAlarms);
if (info.platform === 'android') {
  console.log('Can schedule exact alarms:', info.canScheduleExactAlarms);
}

requestPermissions()

Request relevant permissions for alarm usage on the platform. On Android, may route to settings for exact alarms.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const result = await CapgoAlarm.requestPermissions({ exactAlarm: true });
if (result.granted) {
  console.log('Permissions granted');
} else {
  console.log('Permissions denied');
}

checkPermissions()

Check the current permission state for native alarm access without triggering UI. On iOS this reports AlarmKit readiness; on Android it reports capability details.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const status = await CapgoAlarm.checkPermissions();
console.log('AlarmKit allowed?', status.details?.alarmKit);

getAlarms()

Get a list of alarms scheduled by this app. On iOS 26+, returns alarms from AlarmKit. On Android, this is not supported as the system does not provide an API to query alarms.

import { CapgoAlarm } from '@capgo/capacitor-alarm';

const { alarms } = await CapgoAlarm.getAlarms();
console.log('Scheduled alarms:', alarms);
alarms.forEach(alarm => {
  console.log(`Alarm ${alarm.id}: ${alarm.hour}:${alarm.minute} - ${alarm.label}`);
});

The table above lists the 7 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Full reference

Keep going from Using @capgo/capacitor-alarm

If you are using Using @capgo/capacitor-alarm to plan native plugin work, connect it with @capgo/capacitor-alarm for the implementation detail in @capgo/capacitor-alarm, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.

FAQ

Alarm plugin FAQ

How do I install the Alarm plugin in a Capacitor app?

Run "bun add @capgo/capacitor-alarm" (or "npm install @capgo/capacitor-alarm"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-alarm" in your app code.

Does @capgo/capacitor-alarm work with React, Vue and Angular?

Yes. Alarm is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-alarm support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-alarm free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-alarm/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Alarm without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Alarm changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo