Contents

Activity

The object you use to start, update, and end a Live Activity.

Declaration

class Activity<Attributes> where Attributes : ActivityAttributes

Mentioned 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

Updating a Live Activity

Ending a Live Activity

Observing Live Activity content changes

Observing the Live Activity life cycle

Using ActivityKit push notifications

Checking user authorization

Accessing Live Activities

Identifying a Live Activity

Deprecated

See Also

Starting a Live Activity