MessagingKt

public final class MessagingKt


Summary

Public fields

final @NonNull FirebaseMessaging

Accessing this object for Kotlin apps has changed; see the migration guide.

Public methods

static final @NonNull RemoteMessage

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Public fields

messaging

public final @NonNull FirebaseMessaging messaging

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebaseMessaging instance of the default FirebaseApp.

Important: In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.

Public methods

remoteMessage

public static final @NonNull RemoteMessage remoteMessage(
    @NonNull String to,
    @ExtensionFunctionType @NonNull Function1<@NonNull RemoteMessage.BuilderUnit> init
)

Returns a RemoteMessage instance initialized using the init function.

Important: In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.