FirebasePush

Firebase Cloud Messaging push capability of KMPNotifier.

Install it by passing it to KMPNotifier.initialize — local notifications are installed automatically as a dependency:

KMPNotifier.initialize(configuration, FirebasePush)

The push notifier is then available through notifier (or KMPNotifier.firebasePushNotifier), and push events through addListener.

Firebase delivers push notifications on android and iOS. On desktop and web the extension installs a no-op notifier (token is null, subscriptions do nothing), so shared code can use the same API on every target — exactly like 1.x.

Properties

Link copied to clipboard
open override val dependsOn: List<KMPNotifierExtension>
Link copied to clipboard

The Firebase-backed push notifier.

Functions

Link copied to clipboard
fun addListener(listener: PushListener)

Adds a listener for push events. Safe to call before KMPNotifier.initialize.

Link copied to clipboard
open override fun install(runtime: NotifierRuntime)
Link copied to clipboard

Removes a previously added listener.

Link copied to clipboard
fun setListener(listener: PushListener?)

Replaces all push listeners with the given one. Pass null to remove all listeners.