IMPORTANT: In July 2025, we stopped releasing new versions of KTX modules, and we removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the previously released 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.
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.
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.
[null,null,["Last updated 2025-07-21 UTC."],[],[],null,["com.google.firebase.messaging.ktx\n\nTop-level functions summary \n\nExtension properties summary \n\nTop-level functions \n\nremoteMessage \n\n```\ninline fun [remoteMessage](/docs/reference/kotlin/com/google/firebase/messaging/ktx/package-summary#remoteMessage(kotlin.String,kotlin.Function1))(to: String, crossinline init: RemoteMessage.Builder.() -\u003e Unit): RemoteMessage\n```\n| **This function is deprecated.** \n| Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.\n\nReturns a [RemoteMessage](/docs/reference/kotlin/com/google/firebase/messaging/RemoteMessage) instance initialized using the [init](/docs/reference/kotlin/com/google/firebase/messaging/ktx/package-summary#remoteMessage(kotlin.String,kotlin.Function1)) function.\n\n**Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in `com.google.firebase.firebase-messaging-ktx` are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)\n\nExtension properties \n\nmessaging \n\n```\nval Firebase.messaging: FirebaseMessaging\n```\n\nAccessing this object for Kotlin apps has changed; see the [migration guide](https://firebase.google.com/docs/android/kotlin-migration).\n\nReturns the [FirebaseMessaging](/docs/reference/kotlin/com/google/firebase/messaging/FirebaseMessaging) instance of the default [FirebaseApp](/docs/reference/kotlin/com/google/firebase/FirebaseApp).\n\n**Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in `com.google.firebase.firebase-messaging-ktx` are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)"]]