NexusLiveActivity class

Live Activities — a live, updating view of an in-progress event on the iOS Lock Screen / Dynamic Island and as an Android 16 Live Update (a promoted ongoing notification; older Android: ongoing + progress bar).

Two ways to use it:

  • Server-driven (recommended): design a template in the Nexus dashboard (or send one via the API) and start/update/end it from your server. The SDK renders it on both platforms — nothing to call here.
  • Local: drive it from the app with start / update / end.

iOS needs a one-time Widget Extension that hosts NexusLiveActivityWidget (the NexusLiveActivityKit pod) — see the README. The SDK then manages the ActivityKit lifecycle and registers push-to-start + update tokens for you. For a custom ActivityAttributes type, manage ActivityKit yourself and call registerPushToStartToken / registerActivity.

Constructors

NexusLiveActivity(NexusHttp _http, NexusIdentity _id)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cacheImages(List<String> urls) → Future<void>
iOS: pre-download template image URLs into the App Group, so a server push-started activity can show them (the widget itself can't download). Activities the SDK sees start are cached automatically.
end(String activityId, {Map<String, dynamic>? finalContentState}) → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observePushToStart(String activityType) → Future<void>
Kept for compatibility — observing now starts automatically in wire.
registerActivity({required String activityId, required String activityType, required String platform, String? updateToken, Map<String, dynamic>? contentState}) → Future<void>
registerPushToStartToken(String activityType, String token) → Future<void>
reportEvent(String activityId, String type) → Future<void>
Report a receipt / click / failure for analytics.
start(String activityId, String activityType, Map<String, dynamic> contentState, {Map<String, dynamic>? attributes, Map<String, dynamic>? template}) → Future<void>
Start a live activity locally. iOS → ActivityKit (NexusLiveActivityAttributes); Android → a Live Update. With a template (the same JSON the dashboard produces) contentState is the template's data: { step, state, progress, etaAt, values }. Also registers the instance so the server can update it.
toString() → String
A string representation of this object.
inherited
update(String activityId, Map<String, dynamic> contentState) → Future<void>
wire() → void
Wire native ActivityKit callbacks → backend registration and start observing (push-to-start tokens, push-started activities, diagnostics). Called at init when liveActivityEnabled.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

iosActivityType → const String
The ActivityKit attributes type the SDK widget renders — the type server-driven starts target on iOS.