PPGLiveActivities class

PushPushGo Live Activities for Flutter

Live Activities are real-time, continuously updated notifications driven by the PushPushGo backend: an Android 16 Live Update notification, or an iOS Live Activity on the Lock Screen and Dynamic Island.

The app only decides which live notification to follow — rendering, score and phase updates are handled entirely by the native SDK.

Example:

// After PushpushgoSdk.initialize() and registerForNotifications()
await PPGLiveActivities.instance.initialize(
  appGroupId: 'group.com.your.app.liveactivities', // iOS only
);

if (await PPGLiveActivities.instance.isSupported()) {
  await PPGLiveActivities.instance.subscribe('<liveNotificationId>');
}

PPGLiveActivities.instance.statusStream.listen((event) {
  print('Live Activity: ${event.status}');
});

See LIVE_ACTIVITIES.md for the full integration guide, including the iOS Widget Extension setup.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isInitialized → bool
Check if Live Activities support is initialized
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statusStream → Stream<LiveActivityStatusEvent>
Lifecycle events for subscribed live notifications
no setter

Methods

dispose() → void
Dispose resources (call when app is closing)
getActiveActivities() → Future<List<LiveActivityInfo>>
All Live Activities currently tracked by the native SDK
getSubscriberId(String liveNotificationId) → Future<String?>
The stored subscriber id for a live notification
initialize({String? appGroupId, bool isProduction = true, bool isDebug = false}) → Future<void>
Initialize Live Activities support
isActive(String liveNotificationId) → Future<bool>
Whether a given live notification is currently rendered on this device
isSupported() → Future<bool>
Whether this device can display Live Activities
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setClickHandler(LiveActivityClickHandler handler) → void
Set a handler for taps on a Live Activity
simulatePush(Map<String, String> data) → Future<void>
Feed a push envelope into the rendering pipeline — testing only
subscribe(String liveNotificationId) → Future<String?>
Subscribe this device to a live notification
toString() → String
A string representation of this object.
inherited
unsubscribe(String liveNotificationId) → Future<void>
Unsubscribe this device from a live notification

Operators

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

Static Properties

instance → PPGLiveActivities
Singleton instance
final
shared → PPGLiveActivities
Alternative getter for singleton (matches iOS/Android pattern)
no setter