Skip to content

Live Activities#

Official docs: OneSignal Live Activities

Update iOS Live Activities in real-time (iOS 16.1+).

Note

Live Activities are an iOS-only feature that displays real-time information on the Lock Screen and in the Dynamic Island.

Enter a Live Activity#

await onesignal.live_activities.enter(
    activity_id="delivery_12345",
    token="live_activity_push_token",
)

Exit a Live Activity#

await onesignal.live_activities.exit("delivery_12345")

Push-to-Start Token#

Set a push-to-start token to allow OneSignal to start a Live Activity via push:

await onesignal.live_activities.set_push_to_start_token(
    activity_type="DeliveryActivityAttributes",
    token="push_to_start_token",
)

# Remove the token
await onesignal.live_activities.remove_push_to_start_token(
    "DeliveryActivityAttributes"
)

Default Setup#

await onesignal.live_activities.setup_default()