One Logo Pool Ball
App Frameworks · IOS API REFERENCE

ActivityKit

Share live updates from your app as Live Activities on iPhone, iPad, Apple Watch, and the Mac.

48 types

59 callable entries

11 skipped

84% entry coverage

Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.

Types

Activity

class · iOS 16.1+

Activity.ActivityStateUpdates

struct · iOS 16.1+

Activity.ActivityStateUpdates.AsyncIterator

typealias · iOS 16.1+

Activity.ActivityStateUpdates.Element

typealias · iOS 16.1+

Activity.ActivityStateUpdates.Iterator

struct · iOS 16.1+

Activity.ActivityStateUpdates.Iterator.Element

typealias · iOS 16.1+

Activity.ActivityUpdates

struct · iOS 16.1+

Activity.ActivityUpdates.AsyncIterator

typealias · iOS 16.1+

Activity.ActivityUpdates.Element

typealias · iOS 16.1+

Activity.ActivityUpdates.Iterator

struct · iOS 16.1+

Activity.ActivityUpdates.Iterator.Element

typealias · iOS 16.1+

Activity.ContentState

typealias · iOS 16.1+

Activity.ContentStateUpdates

struct · iOS 16.1+ · Deprecated in iOS 16.2

Activity.ContentStateUpdates.AsyncIterator

typealias · iOS 16.1+ · Deprecated in iOS 16.2

Activity.ContentStateUpdates.Element

typealias · iOS 16.1+ · Deprecated in iOS 16.2

Activity.ContentStateUpdates.Iterator

struct · iOS 16.1+ · Deprecated in iOS 16.2

Activity.ContentStateUpdates.Iterator.Element

typealias · iOS 16.1+ · Deprecated in iOS 16.2

Activity.ContentUpdates

struct · iOS 16.2+

Activity.ContentUpdates.AsyncIterator

typealias · iOS 16.2+

Activity.ContentUpdates.Element

typealias · iOS 16.2+

Activity.ContentUpdates.Iterator

struct · iOS 16.2+

Activity.ContentUpdates.Iterator.Element

typealias · iOS 16.2+

Activity.ID

typealias · iOS 16.1+

Activity.PushTokenUpdates

struct · iOS 16.1+

Activity.PushTokenUpdates.AsyncIterator

typealias · iOS 16.1+

Activity.PushTokenUpdates.Element

typealias · iOS 16.1+

Activity.PushTokenUpdates.Iterator

struct · iOS 16.1+

Activity.PushTokenUpdates.Iterator.Element

typealias · iOS 16.1+

ActivityAttributes

protocol · iOS 16.1+

ActivityAuthorizationError

enum · iOS 16.1+

ActivityAuthorizationInfo

class · iOS 16.1+

ActivityAuthorizationInfo.ActivityEnablementUpdates

struct · iOS 16.1+

ActivityAuthorizationInfo.ActivityEnablementUpdates.AsyncIterator

typealias · iOS 16.1+

ActivityAuthorizationInfo.ActivityEnablementUpdates.Element

typealias · iOS 16.1+

ActivityAuthorizationInfo.ActivityEnablementUpdates.Iterator

struct · iOS 16.1+

ActivityAuthorizationInfo.ActivityEnablementUpdates.Iterator.Element

typealias · iOS 16.1+

ActivityAuthorizationInfo.FrequentPushEnablementUpdates

struct · iOS 16.2+

ActivityAuthorizationInfo.FrequentPushEnablementUpdates.AsyncIterator

typealias · iOS 16.2+

ActivityAuthorizationInfo.FrequentPushEnablementUpdates.Element

typealias · iOS 16.2+

ActivityAuthorizationInfo.FrequentPushEnablementUpdates.Iterator

struct · iOS 16.2+

ActivityAuthorizationInfo.FrequentPushEnablementUpdates.Iterator.Element

typealias · iOS 16.2+

ActivityContent

struct · iOS 16.2+

ActivityState

enum · iOS 16.1+

ActivityStyle

enum · iOS 16.1+

ActivityUIDismissalPolicy

struct · iOS 16.1+

AlertConfiguration

struct · iOS 16.1+

AlertConfiguration.AlertSound

struct · iOS 16.1+

PushType

struct · iOS 16.1+

Functions and constants

method · iOS 16.1+

makeAsyncIterator

TypeScript
makeAsyncIterator(): Activity_ActivityStateUpdates_Iterator<SDKHandle>
Swift declaration
func makeAsyncIterator() -> Activity<Attributes>.ActivityStateUpdates.Iterator

Creates the asynchronous iterator that produces results from this asynchronous sequence.

method · iOS 16.1+

next

TypeScript
next(): Promise<(ActivityState) | null>
Swift declaration
func next() async -> Activity<Attributes>.ActivityStateUpdates.Element?

Asynchronously advances to the next element and returns it, or ends the sequence if there is no next element. - Returns: The next element, if it exists, or `nil` to signal the end of the sequence.

method · iOS 16.1+

makeAsyncIterator

TypeScript
makeAsyncIterator(): Activity_ActivityUpdates_Iterator<SDKHandle>
Swift declaration
func makeAsyncIterator() -> Activity<Attributes>.ActivityUpdates.Iterator

Creates the asynchronous iterator that produces results from this asynchronous sequence.

method · iOS 16.1+

next

TypeScript
next(): Promise<(Activity<SDKHandle>) | null>
Swift declaration
func next() async -> Activity<Attributes>.ActivityUpdates.Element?

Asynchronously advances to the next element and returns it, or ends the sequence if there is no next element. - Returns: The next element, if it exists, or `nil` to signal the end of the sequence.

get · iOS 16.1+ · Deprecated in iOS 16.2

contentState

TypeScript
get contentState(): SDKHandle
Swift declaration
var contentState: Activity<Attributes>.ContentState { get }

The dynamic content of a Live Activity.

get · iOS 16.1+

activityState

TypeScript
get activityState(): ActivityState
Swift declaration
var activityState: ActivityState { get }

The current state of a Live Activity in its life cycle.

method · iOS 16.2+

makeAsyncIterator

TypeScript
makeAsyncIterator(): Activity_ContentUpdates_Iterator<SDKHandle>
Swift declaration
func makeAsyncIterator() -> Activity<Attributes>.ContentUpdates.Iterator

Creates the asynchronous iterator that produces results from this asynchronous sequence.

method · iOS 16.2+

next

TypeScript
next(): Promise<(ActivityContent<SDKHandle>) | null>
Swift declaration
func next() async -> Activity<Attributes>.ContentUpdates.Element?

Asynchronously advances to the next element and returns it, or ends the sequence if there is no next element. - Returns: The next element, if it exists, or `nil` to signal the end of the sequence.

get · iOS 16.2+

contentUpdates

TypeScript
get contentUpdates(): Activity_ContentUpdates<SDKHandle>
Swift declaration
var contentUpdates: Activity<Attributes>.ContentUpdates { get }

An asynchronous sequence you use to observe changes to the dynamic content of a Live Activity.

method · iOS 16.1+

makeAsyncIterator

TypeScript
makeAsyncIterator(): Activity_PushTokenUpdates_Iterator<SDKHandle>
Swift declaration
func makeAsyncIterator() -> Activity<Attributes>.PushTokenUpdates.Iterator

Creates the asynchronous iterator that produces results from this asynchronous sequence.

method · iOS 16.1+

next

TypeScript
next(): Promise<(ArrayBuffer) | null>
Swift declaration
func next() async -> Activity<Attributes>.PushTokenUpdates.Element?

Asynchronously advances to the next element and returns it, or ends the sequence if there is no next element. - Returns: The next element, if it exists, or `nil` to signal the end of the sequence.

get · iOS 16.1+

pushTokenUpdates

TypeScript
get pushTokenUpdates(): Activity_PushTokenUpdates<SDKHandle>
Swift declaration
var pushTokenUpdates: Activity<Attributes>.PushTokenUpdates { get }

An asynchronous sequence you use to observe changes to the push token of a Live Activity.

method · iOS 16.1+ · Deprecated in iOS 16.2

makeAsyncIterator

TypeScript
makeAsyncIterator(): Activity_ContentStateUpdates_Iterator<SDKHandle>
Swift declaration
func makeAsyncIterator() -> Activity<Attributes>.ContentStateUpdates.Iterator

Creates the asynchronous iterator that produces results from this asynchronous sequence.

method · iOS 16.1+ · Deprecated in iOS 16.2

next

TypeScript
next(): Promise<(SDKHandle) | null>
Swift declaration
func next() async -> Activity<Attributes>.ContentStateUpdates.Element?

Asynchronously advances to the next element and returns it, or ends the sequence if there is no next element. - Returns: The next element, if it exists, or `nil` to signal the end of the sequence.

get · iOS 16.1+ · Deprecated in iOS 16.2

contentStateUpdates

TypeScript
get contentStateUpdates(): Activity_ContentStateUpdates<SDKHandle>
Swift declaration
var contentStateUpdates: Activity<Attributes>.ContentStateUpdates { get }

An asynchronous sequence you use to observe changes to the dynamic content of a Live Activity.

get · iOS 16.1+

activityStateUpdates

TypeScript
get activityStateUpdates(): Activity_ActivityStateUpdates<SDKHandle>
Swift declaration
var activityStateUpdates: Activity<Attributes>.ActivityStateUpdates { get }

An asynchronous sequence you use to observe activity state changes.

get · iOS 16.1+

id

TypeScript
get id(): string
Swift declaration
final let id: String

A unique identifier for a Live Activity.

method · iOS 16.1+ · Deprecated in iOS 16.2

end

TypeScript
endUsingDismissalPolicy(contentState?: (SDKHandle) | null, dismissalPolicy?: ActivityUIDismissalPolicy): Promise<void>
Swift declaration
func end(using contentState: Activity<Attributes>.ContentState? = nil, dismissalPolicy: ActivityUIDismissalPolicy = .default) async

Ends an active Live Activity. End an active Live Activity while your app is in the foreground or while it's in the background — for example, by using <doc://com.apple.documentation/documentation/backgroundtasks>. Include updated data in the `contentState` parameter to ensure the Live Activity shows the latest and final content update after it ends. This is important because the Live Activity remains visible until the system or the person removes it. - Parameters: - contentState: The latest and final dynamic content for the Live Activity that ended. The size of the encoded content can't exceed 4KB in size. - dismissalPolicy: Describes how and when the system should dismiss a Live Activity and and remove it from the Lock Screen.

method · iOS 17.2+

end

TypeScript
endDismissalPolicyTimestamp(content: (ActivityContent<SDKHandle>) | null, dismissalPolicy: ActivityUIDismissalPolicy, timestamp: globalThis.Date): Promise<void>
Swift declaration
func end(_ content: ActivityContent<Activity<Attributes>.ContentState>?, dismissalPolicy: ActivityUIDismissalPolicy = .default, timestamp: Date) async

Ends an active Live Activity. End an active Live Activity while your app is in the foreground or while it's in the background — for example, by using <doc://com.apple.documentation/documentation/backgroundtasks>. When you end a Live Activity, include a final content update using the `content` parameter to ensure the Live Activity shows the latest and final content update after it ends. This is important because the Live Activity may remain visible until the system or the person removes it. - Parameters: - content: The latest and final dynamic content for the Live Activity that ended. The size of the encoded content can't exceed 4KB in size. - dismissalPolicy: Describes how and when the system should dismiss a Live Activity and remove it from the Lock Screen. - timestamp: The time the data in the payload was generated. If this is older than a previous update or push payload, the system ignores this update.

method · iOS 16.2+

end

TypeScript
endDismissalPolicy(content?: (ActivityContent<SDKHandle>) | null, dismissalPolicy?: ActivityUIDismissalPolicy): Promise<void>
Swift declaration
func end(_ content: ActivityContent<Activity<Attributes>.ContentState>?, dismissalPolicy: ActivityUIDismissalPolicy = .default) async

Ends an active Live Activity. End an active Live Activity while your app is in the foreground or while it's in the background — for example, by using <doc://com.apple.documentation/documentation/backgroundtasks>. When you end a Live Activity, include a final content update using the `content` parameter to ensure the Live Activity shows the latest and final content update after it ends. This is important because the Live Activity may remain visible until the system or the person removes it. - Parameters: - content: The latest and final dynamic content for the Live Activity that ended. The size of the encoded content can't exceed 4KB in size. - dismissalPolicy: Describes how and when the system should dismiss a Live Activity and and remove it from the Lock Screen.

method · iOS 16.1+ · Deprecated in iOS 16.2

update

TypeScript
updateUsingAlertConfiguration(contentState: SDKHandle, alertConfiguration?: (AlertConfiguration) | null): Promise<void>
Swift declaration
func update(using contentState: Activity<Attributes>.ContentState, alertConfiguration: AlertConfiguration? = nil) async

Updates the dynamic content of a Live Activity and alerts a person about the Live Activity update. The system ignores updates to a Live Activity that's in the ``ActivityKit/ActivityState/ended`` state. - Parameters: - contentState: The updated dynamic content for the Live Activity. The size of the encoded content can't exceed 4KB in size. - alertConfiguration: The alert configuration you use to configure how the system notifies a person about the updated content of the Live Activity.

method · iOS 16.1+ · Deprecated in iOS 16.2

update

TypeScript
updateUsing(contentState: SDKHandle): Promise<void>
Swift declaration
func update(using contentState: Activity<Attributes>.ContentState) async

Updates the dynamic content of the Live Activity. Use this function to update the Live Activity while your app is in the foreground or while it's in the background — for example, by using <doc://com.apple.documentation/documentation/backgroundtasks>. > Note: The system ignores attempts to update a Live Activity that ended. - Parameters: - contentState: The updated dynamic content for the Live Activity. The size of the encoded content can't exceed 4KB in size.

method · iOS 17.2+

update

TypeScript
updateAlertConfigurationTimestamp(content: ActivityContent<SDKHandle>, alertConfiguration: (AlertConfiguration) | null, timestamp: globalThis.Date): Promise<void>
Swift declaration
func update(_ content: ActivityContent<Activity<Attributes>.ContentState>, alertConfiguration: AlertConfiguration? = nil, timestamp: Date) async

Updates the dynamic content of a Live Activity and alerts a person about the Live Activity update. The system ignores updates to a Live Activity that's in the ``ActivityKit/ActivityState/ended`` state. - Parameters: - content: The updated dynamic content for the Live Activity. The size of its ``ActivityKit/ActivityContent/state`` property can't exceed 4KB in size. - alertConfiguration: The alert configuration you use to configure how the system notifies a person about the updated content of the Live Activity. - timestamp: The time the data in the payload was generated. If this is older than a previous update or push payload, the system ignores this update.

method · iOS 16.2+

update

TypeScript
updateAlertConfiguration(content: ActivityContent<SDKHandle>, alertConfiguration?: (AlertConfiguration) | null): Promise<void>
Swift declaration
func update(_ content: ActivityContent<Activity<Attributes>.ContentState>, alertConfiguration: AlertConfiguration? = nil) async

Updates the dynamic content of a Live Activity and alerts a person about the Live Activity update. The system ignores updates to a Live Activity that's in the ``ActivityKit/ActivityState/ended`` state. - Parameters: - content: The updated dynamic content for the Live Activity. The size of its ``ActivityKit/ActivityContent/state`` property can't exceed 4KB in size. - alertConfiguration: The alert configuration you use to configure how the system notifies a person about the updated content of the Live Activity.

method · iOS 16.2+

update

TypeScript
update(content: ActivityContent<SDKHandle>): Promise<void>
Swift declaration
func update(_ content: ActivityContent<Activity<Attributes>.ContentState>) async

Updates the dynamic content of the Live Activity. Use this function to update the Live Activity while your app is in the foreground or while it's in the background — for example, by using <doc://com.apple.documentation/documentation/backgroundtasks>. > Note: The system ignores attempts to update a Live Activity that ended. - Parameters: - content: The updated dynamic content for the Live Activity. The size of its ``ActivityKit/ActivityContent/state`` property can't exceed 4KB in size.

get · iOS 16.2+

content

TypeScript
get content(): ActivityContent<SDKHandle>
Swift declaration
var content: ActivityContent<Activity<Attributes>.ContentState> { get }

The dynamic content of a Live Activity.

get · iOS 16.1+

pushToken

TypeScript
get pushToken(): (ArrayBuffer) | null
Swift declaration
var pushToken: Data? { get }

The token you use to send ActivityKit push notifications to a Live Activity. The push token for a Live Activity may change over time. Use the ``ActivityKit/Activity/pushTokenUpdates`` asynchronous sequence to receive the updated push token. When you receive an updated push token, make sure to send it to your server and invalidate the outdated token.

get · iOS 16.2+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 16.2+

relevanceScore

TypeScript
get relevanceScore(): number
Swift declaration
let relevanceScore: Double

A score you assign that determines the order in which your Live Activities appear when you start several Live Activities for your app. If you start more than one Live Activity in your app, the Live Activity with the highest relevance score appears in the Dynamic Island. If Live Activities have the same relevance score, the system displays the Live Activity that started first. Additionally, the `relevanceScore` determines the order of your Live Activities on the Lock Screen.

init · iOS 16.2+

init

TypeScript
static init(state: number, staleDate?: (globalThis.Date) | null, relevanceScore?: number): ActivityContent<number>
Swift declaration
init(state: State, staleDate: Date?, relevanceScore: Double = 0.0)

Creates the object that describes the state and configuration of a Live Activity.

get · iOS 16.2+

state

TypeScript
get state(): number
Swift declaration
let state: State

The current state of a Live Activity in its life cycle. This value is the same as ``ActivityKit/Activity/activityState``.

get · iOS 16.2+

staleDate

TypeScript
get staleDate(): (globalThis.Date) | null
Swift declaration
let staleDate: Date?

The date when the system considers the Live Activity to be out of date. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ``ActivityKit/ActivityState`` of the Live Activity changes to ``ActivityKit/ActivityState/stale``.

Skipped declarations

11 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

Activity.request(attributes:contentState:pushType:)

This declaration needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.request(attributes:content:pushType:)

This declaration needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.request(attributes:content:pushType:style:)

This declaration needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.request(attributes:content:pushType:style:alertConfiguration:start:)

This declaration needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.request(attributes:content:pushType:style:alertConfiguration:startDate:)

This declaration needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.activities

The containing type needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.activityUpdates

The containing type needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.pushToStartTokenUpdates

The containing type needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.pushToStartToken

The containing type needs Swift generic type arguments. (no canonical witness for Attributes)

Activity.attributes

This declaration needs Swift generic type arguments. (no canonical witness for Attributes)

protocol implementation ActivityAttributes

This protocol needs associated types that cannot yet cross the bridge.