Skills

Activitykit

Implement, review, or improve Live Activities and Dynamic Island experiences in iOS...

Install

npx skills add dpearson2699/swift-ios-skills --skill activitykit -g -a claude-code -y
Category
Mobile
Updated
3mo ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

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-to-update Live Activities, or Lock Screen live widgets.

ActivityKit

ActivityKit owns real-time, glanceable Live Activities displayed on the Lock Screen and Dynamic Island. Ordinary timeline widgets belong in widgetkit, and generic APNs setup belongs in push-notifications; ActivityKit owns the Live Activity lifecycle and payload contract. aps.content-state must decode into the exact ActivityAttributes.ContentState shape, including any coordinated custom date/range encoding. Modern ActivityContent lifecycle examples require iOS 16.2+ unless noted.

See references/activitykit-patterns.md for complete code patterns including push payload formats, concurrent activities, state observation, and testing.

Contents

Workflow

1. Create a new Live Activity

  1. Verify the host app capability and NSSupportsLiveActivities = YES.
  2. Define ActivityAttributes.ContentState; encode and decode a representative fixture that matches the server payload contract.
  3. Create ActivityConfiguration and preview Lock Screen and Dynamic Island states, including stale and terminal content.
  4. Check ActivityAuthorizationInfo.areActivitiesEnabled, then request and observe the activity lifecycle.
  5. Exercise local update and every terminal end path.
  6. For remote updates, validate a complete reference payload before registering rotating update or push-to-start tokens with the server.

2. Review existing Live Activity code

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

ActivityAttributes Definition

Read the whole SKILL.md on GitHub

More in Mobile