Generated from iOS SDK 27.1. Availability is shown on each declaration; permissions and entitlements still apply.
Functions and constants
method · iOS 16.1+makeAsyncIterator
TypeScriptmakeAsyncIterator(): Activity_ActivityStateUpdates_Iterator<SDKHandle>
Swift declarationfunc makeAsyncIterator() -> Activity<Attributes>.ActivityStateUpdates.Iterator
Creates the asynchronous iterator that produces results from this asynchronous sequence.
method · iOS 16.1+next
TypeScriptnext(): Promise<(ActivityState) | null>
Swift declarationfunc 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
TypeScriptmakeAsyncIterator(): Activity_ActivityUpdates_Iterator<SDKHandle>
Swift declarationfunc makeAsyncIterator() -> Activity<Attributes>.ActivityUpdates.Iterator
Creates the asynchronous iterator that produces results from this asynchronous sequence.
method · iOS 16.1+next
TypeScriptnext(): Promise<(Activity<SDKHandle>) | null>
Swift declarationfunc 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.2contentState
TypeScriptget contentState(): SDKHandle
Swift declarationvar contentState: Activity<Attributes>.ContentState { get }
The dynamic content of a Live Activity.
get · iOS 16.1+activityState
TypeScriptget activityState(): ActivityState
Swift declarationvar activityState: ActivityState { get }
The current state of a Live Activity in its life cycle.
method · iOS 16.2+makeAsyncIterator
TypeScriptmakeAsyncIterator(): Activity_ContentUpdates_Iterator<SDKHandle>
Swift declarationfunc makeAsyncIterator() -> Activity<Attributes>.ContentUpdates.Iterator
Creates the asynchronous iterator that produces results from this asynchronous sequence.
method · iOS 16.2+next
TypeScriptnext(): Promise<(ActivityContent<SDKHandle>) | null>
Swift declarationfunc 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
TypeScriptget contentUpdates(): Activity_ContentUpdates<SDKHandle>
Swift declarationvar 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
TypeScriptmakeAsyncIterator(): Activity_PushTokenUpdates_Iterator<SDKHandle>
Swift declarationfunc makeAsyncIterator() -> Activity<Attributes>.PushTokenUpdates.Iterator
Creates the asynchronous iterator that produces results from this asynchronous sequence.
method · iOS 16.1+next
TypeScriptnext(): Promise<(ArrayBuffer) | null>
Swift declarationfunc 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
TypeScriptget pushTokenUpdates(): Activity_PushTokenUpdates<SDKHandle>
Swift declarationvar 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.2makeAsyncIterator
TypeScriptmakeAsyncIterator(): Activity_ContentStateUpdates_Iterator<SDKHandle>
Swift declarationfunc makeAsyncIterator() -> Activity<Attributes>.ContentStateUpdates.Iterator
Creates the asynchronous iterator that produces results from this asynchronous sequence.
method · iOS 16.1+ · Deprecated in iOS 16.2next
TypeScriptnext(): Promise<(SDKHandle) | null>
Swift declarationfunc 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.2contentStateUpdates
TypeScriptget contentStateUpdates(): Activity_ContentStateUpdates<SDKHandle>
Swift declarationvar 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
TypeScriptget activityStateUpdates(): Activity_ActivityStateUpdates<SDKHandle>
Swift declarationvar activityStateUpdates: Activity<Attributes>.ActivityStateUpdates { get }
An asynchronous sequence you use to observe activity state changes.
get · iOS 16.1+id
TypeScriptget id(): string
Swift declarationfinal let id: String
A unique identifier for a Live Activity.
method · iOS 16.1+ · Deprecated in iOS 16.2end
TypeScriptendUsingDismissalPolicy(contentState?: (SDKHandle) | null, dismissalPolicy?: ActivityUIDismissalPolicy): Promise<void>
Swift declarationfunc 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
TypeScriptendDismissalPolicyTimestamp(content: (ActivityContent<SDKHandle>) | null, dismissalPolicy: ActivityUIDismissalPolicy, timestamp: globalThis.Date): Promise<void>
Swift declarationfunc 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
TypeScriptendDismissalPolicy(content?: (ActivityContent<SDKHandle>) | null, dismissalPolicy?: ActivityUIDismissalPolicy): Promise<void>
Swift declarationfunc 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.2update
TypeScriptupdateUsingAlertConfiguration(contentState: SDKHandle, alertConfiguration?: (AlertConfiguration) | null): Promise<void>
Swift declarationfunc 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.2update
TypeScriptupdateUsing(contentState: SDKHandle): Promise<void>
Swift declarationfunc 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
TypeScriptupdateAlertConfigurationTimestamp(content: ActivityContent<SDKHandle>, alertConfiguration: (AlertConfiguration) | null, timestamp: globalThis.Date): Promise<void>
Swift declarationfunc 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
TypeScriptupdateAlertConfiguration(content: ActivityContent<SDKHandle>, alertConfiguration?: (AlertConfiguration) | null): Promise<void>
Swift declarationfunc 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
TypeScriptupdate(content: ActivityContent<SDKHandle>): Promise<void>
Swift declarationfunc 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
TypeScriptget content(): ActivityContent<SDKHandle>
Swift declarationvar content: ActivityContent<Activity<Attributes>.ContentState> { get }
The dynamic content of a Live Activity.
get · iOS 16.1+pushToken
TypeScriptget pushToken(): (ArrayBuffer) | null
Swift declarationvar 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
TypeScriptget description(): string
Swift declarationvar 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
TypeScriptget relevanceScore(): number
Swift declarationlet 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
TypeScriptstatic init(state: number, staleDate?: (globalThis.Date) | null, relevanceScore?: number): ActivityContent<number>
Swift declarationinit(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
TypeScriptget state(): number
Swift declarationlet 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
TypeScriptget staleDate(): (globalThis.Date) | null
Swift declarationlet 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``.