InvergeDocs
PythonAPI reference

Live Activities

Live Activities — a live, updating view of an in-progress event.

// access
client.live_activities

Live Activities — a live, updating view of an in-progress event.

iOS renders it on the Lock Screen / Dynamic Island; Android as an ongoing live notification. The classic server-side shape: start when the order/ride/match begins, update as its status changes, end when it's done.

iOS needs the APNs key configured in the console (Live Activities cannot go through FCM) and a Widget Extension in the app. Android needs no extra setup.

LiveActivities

class

client.live_activities

Extends Resource.

View source

activity()

method
def activity(activity_type_or_id, activity_id=None) -> LiveActivityBuilder

Start a fluent activity.

activity(type, id) to start one; activity(id) to update or end an existing one (the type is only needed at start).

Parameters

Prop

Type

Returns LiveActivityBuilder

View source

template()

method
def template(template, activity_id) -> LiveActivityBuilder

A templated activity: template is a template key from the Nexus console (e.g. "order_tracking") or an inline design. Send only data.

Parameters

Prop

Type

Returns LiveActivityBuilder

View source

start_template()

method
def start_template(template, activity_id, data=None, *, distinct_ids=None, lang=None, alert=None, attributes=None, stale_date=None, priority=None) -> Dict[str, Any]

Start a templated activity. data: step, state, progress, etaAt (unix s), values. Each device gets its own language unless lang forces one. Returns {ios, android, iosTargets, iosWarning?}.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

update_data()

method
def update_data(activity_id, data, *, stale_date=None, priority=None) -> Dict[str, Any]

Update a templated activity with partial data — merged server-side (None inside data clears a field).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

start()

method
def start(activity_type, activity_id, content_state=None, *, distinct_ids=None, attributes=None, stale_date=None, priority=None) -> Dict[str, Any]

Start an activity. Omit distinct_ids for a shared activity.

Returns {ios, android} — how many devices were reached.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

update()

method
def update(activity_id, content_state=None, *, stale_date=None, priority=None) -> Dict[str, Any]

Push a new content state. priority 5 = routine (unmetered), 10 = immediate (metered).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

end()

method
def end(activity_id, content_state=None, *, data=None, dismissal_date=None) -> Dict[str, Any]

End the activity, optionally with a final state and dismissal time. Templated: data is the final state, e.g. {"step": "completed"}.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

register_push_to_start_token()

method
def register_push_to_start_token(activity_type, token, *, distinct_id=None, device_key=None) -> Dict[str, Any]

Register an iOS push-to-start token (normally the client SDK's job).

Parameters

Prop

Type

Returns Dict[str, Any]

View source

register_activity()

method
def register_activity(activity_id, activity_type, *, platform='ios', update_token=None, distinct_id=None, content_state=None) -> Dict[str, Any]

Register a running activity instance's update token.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

event()

method
def event(activity_id, type, *, platform=None) -> Dict[str, Any]

Report a delivery receipt / click / failure for analytics.

Parameters

Prop

Type

Returns Dict[str, Any]

View source

On this page