Activity
The object you use to start, update, and end a Live Activity.
Declaration
class Activity<Attributes> where Attributes : ActivityAttributesMentioned in
Overview
The Activity object offers functionality to start, update, and end a Live Activity from within your app. You can update or end a Live Activity while your app is in the background, but you can only start a Live Activity while the app is in the foreground, unless you adopt App Intents and start the Live Activity using a LiveActivityIntent.
Additionally, Activity offers functionality to observe changes to:
The Live Activity
The Live Activity’s state in its life cycle
A person’s permission to start Live Activities
The Live Activity’s push token if you configure it to receive updates through ActivityKit push notifications.
To observe these changes, use the asynchronous sequences the activity object offers; for example, use the activityStateUpdates sequence to observe changes to the state of a Live Activity.
Topics
Starting a Live Activity
request(attributes:content:pushType:)request(attributes:content:pushType:style:)request(attributes:content:pushType:style:alertConfiguration:start:)request(attributes:content:pushType:style:alertConfiguration:startDate:)attributesActivityAttributesActivityStylecontentActivityContentActivity.ContentStatePushTypeActivityAuthorizationError