Skip to content

Live Activities#

flet_onesignal.live_activities.OneSignalLiveActivities #

OneSignal Live Activities namespace (iOS only).

Provides methods for managing Live Activities, which display real-time information on the iOS Lock Screen and Dynamic Island.

Functions#

enter async #

enter(activity_id: str, token: str) -> None

Enter a Live Activity.

Call this when the user starts a Live Activity that should receive push updates from OneSignal.

Parameters:

Name Type Description Default
activity_id str

A unique identifier for the Live Activity.

required
token str

The push token for the Live Activity.

required

exit async #

exit(activity_id: str) -> None

Exit a Live Activity.

Call this when the Live Activity ends or the user dismisses it.

Parameters:

Name Type Description Default
activity_id str

The identifier of the Live Activity to exit.

required

remove_push_to_start_token async #

remove_push_to_start_token(activity_type: str) -> None

Remove the push-to-start token for a Live Activity type.

Parameters:

Name Type Description Default
activity_type str

The type identifier of the Live Activity.

required

set_push_to_start_token async #

set_push_to_start_token(
    activity_type: str, token: str
) -> None

Set the push-to-start token for a Live Activity type.

This allows OneSignal to start a Live Activity via push notification.

Parameters:

Name Type Description Default
activity_type str

The type identifier of the Live Activity.

required
token str

The push-to-start token.

required

setup_default async #

setup_default(options: Optional[dict] = None) -> None

Setup default Live Activity options.

Parameters:

Name Type Description Default
options Optional[dict]

Optional configuration options for Live Activities.

None