Back to Skills

activitykit

Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for the Lock Screen and Dynamic Island — delivery tracking, sports scores, ride-sharing status, workout timers, media playback, or any time-sensitive information that updates in real time. Also use when working with ActivityKit, ActivityAttributes, Activity lifecycle (request/update/end), Dynamic Island layouts (compact/minimal/expanded), push-t

832stars43forksUpdated 7/5/2026

Security Assessment

Safe(100/100)
Security Score100/100

About activitykit

activitykit helps implement, review, and improve Live Activities and Dynamic Island experiences in iOS apps using Apple's ActivityKit framework. Live Activities are real-time, glanceable displays on the Lock Screen and, on supported devices, the Dynamic Island, well suited to delivery tracking, sports scores, ride-sharing status, workout timers, and media playback. The skill keeps clear routing boundaries: ordinary Home Screen and timeline widgets belong to a widgetkit skill and generic APNs setup to push-notifications, while Live Activity-specific payload shapes stay in scope here.

It covers the full workflow for creating a Live Activity: adding NSSupportsLiveActivities to the host app's Info.plist, defining an ActivityAttributes struct with a nested ContentState, building an ActivityConfiguration with Lock Screen and Dynamic Island closures, starting the activity with Activity.request, updating with activity.update and ending with activity.end, and forwarding push tokens to a server for remote updates. Static attributes are set once at creation while the dynamic ContentState, kept deliberately small because it is serialized on every update, carries changing data. The skill explains staleDate and relevanceScore on ActivityContent, AlertConfiguration for visible update banners, and dismissal policies (.default, .immediate, and .after) that control how long an ended activity lingers.

For push-to-update, it documents the Live Activity payload invariants: apns-push-type of liveactivity, an apns-topic of <bundle-id>.push-type.liveactivity, and an aps.content-state that must decode into the app's actual ActivityAttributes.ContentState Codable shape, cautioning against assuming a particular encoding for Date or ClosedRange<Date> unless the Swift model and server contract agree. Patterns target iOS 26+ with Swift 6.3, with lifecycle examples requiring iOS 16.2+ and Lock Screen support from iOS 16.1+. Use it when building or reviewing any time-sensitive, real-time updating widget; it emphasizes ending activities on every terminal path and correctly distinguishing the active lifetime from post-end Lock Screen linger. A references file holds complete code patterns for payloads, concurrent activities, state observation, and testing.

FAQ

What kinds of features is ActivityKit meant for?

Real-time, glanceable Live Activities on the Lock Screen and Dynamic Island, such as delivery tracking, sports scores, ride-sharing status, workout timers, and media playback.

What are the steps to create a Live Activity?

Add NSSupportsLiveActivities to Info.plist, define an ActivityAttributes struct with a nested ContentState, build an ActivityConfiguration, start it with Activity.request, update and end it, and forward push tokens for remote updates.

What push headers are required for remote Live Activity updates?

An apns-push-type of liveactivity and an apns-topic of <bundle-id>.push-type.liveactivity, with an aps.content-state that decodes into the app's ActivityAttributes.ContentState.

Why should ContentState be kept small?

Because the entire struct is serialized on every update and push payload, so a smaller state keeps updates efficient.

What iOS versions do the patterns target?

They target iOS 26+ with Swift 6.3; the modern ActivityContent lifecycle examples require iOS 16.2+, and Lock Screen Live Activities are supported from iOS 16.1+.

All Files

3 files
SKILL.md19.6 KB
View
references/activitykit-patterns.md32.4 KB
View
evals/evals.json3.9 KB
View

Install activitykit

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill