TechnologiesUI & App Frameworks

ActivityKit

iOSmacOStvOSwatchOSvisionOS

ActivityKit lets you start, update, and end Live Activities that show real-time app data on the Lock Screen and in the Dynamic Island. You define the data a Live Activity displays by conforming a type to ActivityAttributes and packaging its dynamic state in ActivityContent, then manage the activity's life cycle through the Activity class as it moves between the cases of ActivityState. Use ActivityAuthorizationInfo to check whether the user permits Live Activities, drive remote updates with PushType, and tailor presentation with types such as AlertConfiguration and ActivityUIDismissalPolicy.

Live Activities 3

Create and manage the life cycle of a Live Activity that displays real-time data on the Lock Screen and in the Dynamic Island.

  • Cl
    Activity
    The object you use to start, update, and end a Live Activity.
  • En
    ActivityState
    The enum that describes the state of a Live Activity in its life cycle.
  • En
    ActivityStyle
    An enumeration of the presentation styles available for a Live Activity.

Defining Activity Data 2

Describe the static and dynamic data a Live Activity presents.

  • Pr
    ActivityAttributes
    The protocol you implement to describe the content of a Live Activity.
  • St
    ActivityContent
    A structure that describes the state and configuration of a Live Activity.

Authorization 2

Determine whether the user permits your app to start Live Activities and handle related errors.

  • Cl
    ActivityAuthorizationInfo
    An object with information about whether a person allowed your app to start Live Activities and permitted
  • En
    ActivityAuthorizationError
    An error that indicates why the request to start a Live Activity failed.

Remote Updates 1

Update and end Live Activities through push notifications.

  • St
    PushType
    The structure that offers constants you use to configure a Live Activity to receive updates through ActivityKit

Presentation and Dismissal 2

Configure alerts and control how a Live Activity is dismissed from the screen.

  • St
    AlertConfiguration
    A structure you use to configure an alert that appears when you update your Live Activity.
  • St
    ActivityUIDismissalPolicy
    The structure that describes when the system should remove a Live Activity that ended.
← UI & App Frameworks