AnalyticsPush class final

Push, as the SDK sees it: a token to register, the permission, and taps to route. Reached as Analytics.push.

Rendering a push and reporting its receipt are native and never pass through Dart: on Android the app adds sdk-android-fcm (or hands messages to the SDK natively), on iOS a notification service extension does it — both run when the app's Dart does not (docs/sdk-flutter.md, "Push").

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
taps → Stream<PushTap>
Every tapped notification of ours, the one that started the app included. The SDK has already recorded the open; what is left is where to go, which only the app knows. Taps that arrive before anything listens are held for the first listener, so a cold start's tap is not lost while the app is still building its first screen.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notificationsEnabled() → Future<bool>
Whether a push can reach the person now. On Android this includes the SDK's own channel being switched on.
refreshToken() → Future<void>
Re-registers the last token if the permission has changed under it. The SDKs call it themselves at startup; requestPermission calls it with the answer.
registeredToken() → Future<String?>
The token this install last registered, or null. For a settings or debug screen.
requestPermission() → Future<bool>
Asks the person for permission to show notifications — Android 13's runtime permission, iOS's authorization — and registers the answer. True when notifications are allowed afterwards. On iOS an answer of yes also registers for remote notifications. On Android the app's manifest must declare android.permission.POST_NOTIFICATIONS: neither the SDK nor the plugin does, so that a permission never reaches an app through the manifest merge, and without it the answer is false.
setToken(String token, {String kind = TokenKinds.fcm}) → Future<void>
Registers this install's push token with its kind, one of TokenKinds. Sends $push_token only when something changed since the last one, so it is safe on every launch.
toString() → String
A string representation of this object.
inherited

Operators

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