Android Compose: Firebase App notifications

Andres Sandoval
2 min readAug 12, 2024

How to add app push notifications to your Android app

Steps

  1. Create a new Firebase Project https://console.firebase.google.com
  2. Add google-services.json file to your project

3. Add the below dependencies to Android project and sync project

Inside the file build.gradle.kts(:app)

plugins {
..
id("com.google.gms.google-services")
}


android{
..
dependencies {
..
implementation (platform("com.google.firebase:firebase-bom:33.1.2"))
implementation("com.google.firebase:firebase-messaging-ktx")
}
}

Inside the file build.gradle.kts(Project)

plugins {
..
id("com.google.gms.google-services") version "4.4.2" apply false
}

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />

MainActivity initialize Firebase app

FirebaseApp.initializeApp(this)

Run the app. Firebase is now configure on your app.

Next: Create a notification using Firebase dashboard

  1. Go to Firebase dashboard message https://console.firebase.google.com/u/0/project/tour-guide-b855c/messaging

--

--

Andres Sandoval
Andres Sandoval

No responses yet