InvergeDocs
FlutterAPI reference

Live Activities

Live Activities in the Flutter SDK.

import 'package:nexus_flutter/nexus.dart';

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.

ConstantDescription
static const String iosActivityType = 'NexusLiveActivityAttributes'The ActivityKit attributes type the SDK widget renders — the type server-driven starts target on iOS.
View source

wire()

method
void wire()

Wire native ActivityKit callbacks → backend registration and start observing (push-to-start tokens, push-started activities, diagnostics). Called at init when liveActivityEnabled.

View source

registerPushToStartToken()

method
Future<void> registerPushToStartToken(String activityType, String token)

Parameters

Prop

Type

View source

registerActivity()

method
Future<void> registerActivity({required String activityId, required String activityType, required String platform, String? updateToken, Map<String, dynamic>? contentState})

Parameters

Prop

Type

View source

reportEvent()

method
Future<void> reportEvent(String activityId, String type)

Report a receipt / click / failure for analytics.

Parameters

Prop

Type

View source

start()

method
Future<void> start(String activityId, String activityType, Map<String, dynamic> contentState, {Map<String, dynamic>? attributes, Map<String, dynamic>? template})

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.

Parameters

Prop

Type

View source

update()

method
Future<void> update(String activityId, Map<String, dynamic> contentState)

Parameters

Prop

Type

View source

end()

method
Future<void> end(String activityId, {Map<String, dynamic>? finalContentState})

Parameters

Prop

Type

View source

cacheImages()

method
Future<void> cacheImages(List<String> urls)

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.

Parameters

Prop

Type

View source

observePushToStart()

method
Future<void> observePushToStart(String activityType)

Kept for compatibility — observing now starts automatically in wire.

Parameters

Prop

Type

View source

On this page