Skip to content
Mobile
Skill

/alarmkit

Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, system Stop and AlarmButton secondary actions, authorization,

From plugin
swift-ios-skills
1.3k86 skills1 MCP

Claude Code

$ npx -y skills add dpearson2699/swift-ios-skills --skill alarmkit --agent claude-code

SKILL.md

alarmkit.SKILL.md
name: alarmkit
description: "Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, system Stop and AlarmButton secondary actions, authorization, state observation, countdown widget-extension handoff, and Live Activity integration. Use when building wake-up alarms, countdown timers, or alarm-style alerts that need Apple's system alarm experience."

AlarmKit

Schedule prominent alarms and countdown timers that surface on the Lock Screen, Dynamic Island, StandBy, and a paired Apple Watch when the alarm fires. AlarmKit requires iOS 26+ / iPadOS 26+. Alarms can break through Focus and Silent mode.

AlarmKit uses ActivityKit data models for its Live Activity, but the firing alert is system-managed alarm UI, not a general custom notification UI surface. Custom UI belongs only to countdown and paused Live Activity states rendered by a Widget Extension with the same `AlarmAttributes<Metadata>` and `AlarmPresentationState` used when scheduling.

See [references/alarmkit-patterns.md](references/alarmkit-patterns.md) for complete code patterns including authorization, scheduling, countdown timers, snooze handling, and widget setup.

import AlarmKit

Contents

  • [Workflow](#workflow)
  • [Authorization](#authorization)
  • [Alarm vs Timer Decision](#alarm-vs-timer-decision)
  • [Scheduling Alarms](#scheduling-alarms)
  • [Countdown Timers](#countdown-timers)
  • [Alarm States](#alarm-states)
  • [AlarmAttributes and AlarmPresentation](#alarmattributes-and-alarmpresentation)
  • [AlarmButton](#alarmbutton)
  • [Live Activity Integration](#live-activity-integration)
  • [Common Mistakes](#common-mistakes)
  • [Review Checklist](#review-checklist)
  • [References](#references)

Workflow

1. Create a new alarm or timer

1. Add `NSAlarmKitUsageDescription` to Info.plist with a user-facing string. 2. Request authorization with `AlarmManager.shared.requestAuthorization()` when the app can explain the value, or handle the first-schedule system prompt. 3. If authorization is `.denied` or not `.authorized`, show recovery UI instead of scheduling. 4. Configure `AlarmPresentation` (alert, countdown, paused states). 5. Create `AlarmAttributes` with the presentation, optional metadata, and tint color. 6. Build an `AlarmManager.AlarmConfiguration` (.alarm or .timer). 7. Schedule with `AlarmManager.shared.schedule(id:configuration:)`. 8. Observe `alarmManager.alarmUpdates` and confirm the scheduled ID reaches the expected state. 9. If using countdown, add a Widget Extension target with an `ActivityConfiguration` for the same `AlarmAttributes<Metadata>` type.

2. Review existing alarm code

Run through the Review Checklist at the end of this document.

Authorization

AlarmKit requires user authorization. Request early when the app can explain the value, or let AlarmKit prompt automatically on first schedule. If authorization is not granted after the explicit or automatic prompt, alarms are not scheduled and will not alert.

let manager = AlarmManager.shared

// Request authorization explicitly
let state = try await manager.requestAuthorization()
guard state == .authorized else { return }

// Check current state synchronously
let current = manager.authorizationState // .authorized, .denied, .notDetermined

// Observe authorization changes
for await state in manager.authorizationUpdates {
    switch state {
    case .authorized: print("Alarms enabled")
    case .denied:     print("Alarms disabled")
    case .notDetermined: break
    @unknown default: break
    }
}

Alarm vs Timer Decision

| Feature | Alarm (`.alarm`) | Timer (`.timer`) | |---|---|---| | Fires at | Specific time (schedule) | After duration elapses | | Countdown UI | Optional | Always shown | | Recurring | Yes (weekly days) | No | | Use case | Wake-up, scheduled reminders | Cooking, workout intervals |

Use `.alarm(schedule:...)` when firing at a clock time. Use `.timer(duration:...)` when firing after a duration from now.

Scheduling Alarms

Alarm.Schedule

Use `.fixed(date)` for a one-time absolute date or `.relative` for a local clock time with `.never` or `.weekly` repetition. Load [Recurring Alarm Patterns](references/alarmkit-patterns.md#recurring-alarm-patterns) for daily, weekday, weekend, and fixed-date variants.

Schedule and Configure

let id = UUID()

let alert = AlarmPresentation.Alert(
    title: "Wake Up",
    secondaryButton: AlarmButton(
        text: "Snooze", textColor: .white, systemImageName: "bell.slash"
    ),
    secondaryButtonBehavior: .countdown
)
let presentation = AlarmPresentation(alert: alert)
struct EmptyAlarmMetadata: AlarmMetadata {}
let attributes = AlarmAttributes<EmptyAlarmMetadata>(
    presentation: presentation,
    metadata: nil,
    tintColor: .indigo
)

let snooze = Alarm.CountdownDuration(preAlert: nil, postAlert: 300)
let configuration = AlarmManager.AlarmConfiguration(
    countdownDuration: snooze,
    schedule: .relative(.init(
        time: .init(hour: 7, minute: 0),
        repeats: .never
    )),
    attributes: attributes,
    sound: .default
)

let alarm = try await AlarmManager.shared.schedule(
    id: id,
    configuration: configuration
)

For an authorization-gated function and metadata-bearing variant, load [Complete Alarm Scheduling Flow](references/alarmkit-patterns.md#complete-alarm-scheduling-flow).

`stopIntent` and `secondaryIntent` default to `nil`. Omit `stopIntent` for AlarmKit's standard system Stop behavior; provide it only when Stop must run app cleanup, custom stop behavior, or other side effects. Omit `secondaryIntent` for ordinary Snooze/Repeat with `secondaryButtonBehavior: .countdown` and `Alarm.CountdownDuration.postAlert`; provide it only for `.custom` secondary behavior or app cleanup/custom behavior.

Alarm State Transitions

cancel(id:)
    |
schedu
Read more
@dpearson2699
Ships withswift-ios-skills

86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.

1.3k86 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.3k
Star history of dpearson2699/swift-ios-skills on GitHub, a chart by star-history.com

Other skills on swift-ios-skills.

app-clips

app-clips

Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store…

More skills from other plugins.

deep-code-review

deep-code-review

In-depth design-focused code review - understands codebase context before evaluating PR changes, posts structured feedback to…

expo1d53k
@expo@expoInstall Skill
modlens

modlens

Plug-in vision for text-only models. Hard rule: when a file path or URL with an image extension (.png, .jpg, .jpeg, .webp, .gif,…

modlens2w4.6k
@liustack@liustackInstall Skill
appllama-app-design-skill

appllama-app-design-sk…

Build native-feeling, benchmark-quality mobile app screens (Expo / React Native). Use when designing or implementing any mobile…

appllama2mo3.9k
@appllama@appllamaInstall Skill

Questions about alarmkit.

Which coding agents can use alarmkit?
alarmkit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.