Zum Inhalt springen

@capgo/capacitor-alarm

Dieser Inhalt ist in Ihrer Sprache noch nicht verfügbar.

@capgo/capacitor-alarm

Manage native alarm Capacitor plugin

Installation

Terminal window
npm install @capgo/capacitor-alarm
npx cap sync

Requirements

  • iOS: iOS 26+ only. This plugin relies on AlarmKit APIs and will report unsupported on earlier versions or when the framework is unavailable.
  • Android: Uses AlarmClock intents; behavior depends on the default Clock app and OEM policies.

Note: This plugin only exposes native alarm actions (create/open). It does not implement any custom in-app alarm scheduling/CRUD.

API

createAlarm(…)

createAlarm(options: NativeAlarmCreateOptions) => Promise<NativeActionResult>

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

ParamType
optionsNativeAlarmCreateOptions

Returns: Promise<NativeActionResult>

openAlarms()

openAlarms() => Promise<NativeActionResult>

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

Returns: Promise<NativeActionResult>

getOSInfo()

getOSInfo() => Promise<OSInfo>

Get information about the OS and capabilities.

Returns: Promise<OSInfo>

requestPermissions(…)

requestPermissions(options?: { exactAlarm?: boolean | undefined; } | undefined) => Promise<PermissionResult>

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

ParamType
options{ exactAlarm?: boolean; }

Returns: Promise<PermissionResult>

Interfaces

NativeActionResult

PropType
successboolean
messagestring

NativeAlarmCreateOptions

Options for creating a native OS alarm via the platform clock app.

PropTypeDescription
hournumberHour of day in 24h format (0-23)
minutenumberMinute of hour (0-59)
labelstringOptional label for the alarm
skipUibooleanAndroid only: attempt to skip UI if possible
vibratebooleanAndroid only: set alarm to vibrate

OSInfo

Returned info about current OS and capabilities.

PropTypeDescription
platformstring’ios’ | ‘android’ | ‘web’
versionstringOS version string
supportsNativeAlarmsbooleanWhether the platform exposes a native alarm app integration
supportsScheduledNotificationsbooleanWhether scheduling local notifications is supported
canScheduleExactAlarmsbooleanAndroid only: whether exact alarms are allowed

PermissionResult

Result of a permissions request.

PropTypeDescription
grantedbooleanOverall grant for requested scope
detailsRecord<string, boolean>Optional details by permission key