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=================================\n\nTop-level functions summary\n---------------------------\n\n|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inline `[RemoteMessage](/docs/reference/kotlin/com/google/firebase/messaging/RemoteMessage) | ~~[remoteMessage](/docs/reference/kotlin/com/google/firebase/messaging/ktx/package-summary#remoteMessage(kotlin.String,kotlin.Function1))~~`(to: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, crossinline init: `[RemoteMessage.Builder](/docs/reference/kotlin/com/google/firebase/messaging/RemoteMessage.Builder)`.() `-\u003e` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` **This function is deprecated.** Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |\n\nExtension properties summary\n----------------------------\n\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [FirebaseMessaging](/docs/reference/kotlin/com/google/firebase/messaging/FirebaseMessaging) | [Firebase](/docs/reference/kotlin/com/google/firebase/ktx/Firebase)`.`[messaging](/docs/reference/kotlin/com/google/firebase/messaging/ktx/package-summary#(com.google.firebase.ktx.Firebase).messaging()) Accessing this object for Kotlin apps has changed; see the [migration guide](https://firebase.google.com/docs/android/kotlin-migration). |\n\nTop-level functions\n-------------------\n\n### remoteMessage\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**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.](https://firebase.google.com/docs/android/kotlin-migration)\n\nExtension properties\n--------------------\n\n### messaging\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**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.](https://firebase.google.com/docs/android/kotlin-migration)"]]