NexusLiveActivity class

Live Activities — a live, updating view of an in-progress event on the iOS Lock Screen / Dynamic Island and as an Android live ongoing notification.

Two ways to use it:

  • Server-driven (recommended): start/update/end from the dashboard or the Live Activity API. iOS receives ActivityKit push updates; Android receives a data message the SDK turns into a live notification — nothing to call here.
  • Local: drive it from the app with start / update / end.

For iOS you also ship a Widget Extension (the ActivityKit layout). With the turn-key default attributes the SDK manages the ActivityKit lifecycle and registers push-to-start + update tokens for you; for a typed setup, 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

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>
Observe push-to-start tokens (iOS 17.2+) so the server can start activities remotely. No-op off iOS.
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}) → Future<void>
Start a live activity locally. iOS → ActivityKit (default attributes); Android → a live ongoing notification. 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 token callbacks → backend registration. Called at init when liveActivityEnabled.

Operators

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