LiveUpdatesPlatform class abstract
Native backend used by LiveUpdates. Implemented with FFIgen on iOS and JNIgen on Android; NoopLiveUpdatesPlatform everywhere else.
Custom implementations (for example test fakes) should extend NoopLiveUpdatesPlatform: methods may be added to this class in minor releases, and the no-op base keeps such implementations compiling.
- Implementers
Constructors
Properties
-
events
→ Stream<
(String, String)> -
Lifecycle events as
(id, event); event isstarted,active,stale,endedordismissed.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
pushToStartTokens
→ Stream<
LiveUpdatePushToken> -
Push-to-start tokens.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
taps
→ Stream<
String> -
Tap routes.
no setter
Methods
-
actions(
{String? updateId}) → Stream< (String, String)> -
Button presses as
(update id, action id), of updateupdateIdonly when given. Presses go to the app only while one of these streams is listened to; otherwise the background action handler runs. -
activeIds(
) → Future< List< String> > - Ids of live updates currently shown.
-
backgroundActionHandler(
) → Future< int?> - Raw callback handle of the background action handler, if registered.
-
backgroundActionsDone(
) → Future< void> - Signals that the background handler finished.
-
canPostPromotedNotifications(
) → Future< bool> - See LiveUpdates.canPostPromotedNotifications.
-
end(
String id, {LiveUpdateContent? finalContent, Duration? dismissAfter}) → Future< void> -
Ends the live update with
id. -
endAll(
) → Future< void> - Ends every live update of this app.
-
handleRemotePayload(
Map< String, Object?> data) → Future<bool> -
Applies a remote payload;
falseif it is not a live_updates message. -
idForKey(
String key) → Future< String?> -
Id of the running live update with key
key. -
isSupported(
) → Future< bool> - See LiveUpdates.isSupported.
-
keyForId(
String id) → Future< String?> -
Key of the live update
id, ornullwhen it was started without one. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pushTokens(
String id) → Stream< LiveUpdatePushToken> -
Push tokens for the live update with
id. -
requestPermission(
) → Future< bool> - See LiveUpdates.requestPermission.
-
setBackgroundActionHandler(
int dispatcher, int handler) → Future< void> - Stores the callback handles used to run LiveUpdates.setBackgroundActionHandler's handler in a headless engine.
-
start(
LiveUpdateContent content, {bool pushUpdates = false, String? iosChannelId}) → Future< String> - Starts a live update and returns its id.
-
startOrUpdate(
String key, LiveUpdateContent content, {bool pushUpdates = false, String? iosChannelId}) → Future< String> -
Updates the live update with key
keyor starts one; returns its id. -
takeQueuedActions(
) → Future< List< (String, String)> > - Removes and returns the presses queued for the background handler.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
String id, LiveUpdateContent content) → Future< void> -
Updates the live update with
id.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ LiveUpdatesPlatform
-
The active backend. Replace in tests with a fake.
getter/setter pair