Skip to content
Notifie
Documentation
DocsGet started

Get started

Android push setup

Configure the Firebase Android client, upload the server-only sending credential, and register an FCM device.

How the SDK finds Firebase

The SDK prefers whatever the app already has. If google-services.json is present it uses that Firebase and makes no network call, so an app with its own Firebase keeps behaving exactly as before. Only when there is no local configuration does it ask Notifie for one.

The values it receives — project id, application id, API key, sender id — are the same four the Google Services plugin would have compiled into your APK, so Notifie is not publishing anything your released app does not already contain. The service account never leaves the server.

The lookup needs the service account to carry firebase.projects.get, which newly created Firebase projects grant by default. Where it does not, Notifie logs the reason and the SDK falls back to the file.

1. Register the Android app in Firebase

  1. Open Firebase Console and select the project.
  2. Choose Project settings → Your apps → Add app → Android.
  3. Enter the exact applicationId from the app module.
  4. Download google-services.json to app/google-services.json, or android/app/google-services.json for Flutter and React Native.

2. Apply the Google Services plugin

settings.gradle.kts or root build.gradle.kts
plugins {
    id("com.google.gms.google-services") version "4.4.2" apply false
}
app/build.gradle.kts
plugins {
    id("com.google.gms.google-services")
}

notifie doctor detects a missing client file and missing Gradle plugin separately, so the repair points to the broken layer.

3. Let the CLI finish the wiring

Run this from the repository root. It validates google-services.json, then adds the missing POST_NOTIFICATIONS permission and Google Services plugin entries. Apply the Gradle blocks above by hand if the CLI cannot safely edit your build files.

Terminal
notifie init YOUR_SDK_INGEST_KEY --yes

4. Upload the sending credential to Notifie

  1. In Firebase, choose Project settings → Service accounts → Generate new private key.
  2. Open the application in the Notifie dashboard.
  3. Go to Settings → Push → Firebase Cloud Messaging and upload that service-account JSON.

Notifie validates the credential with Google, encrypts it at rest, and never sends it back to the browser.

5. Register and verify

Application.kt
Notifie.initialize(applicationContext, BuildConfig.NOTIFIE_KEY)
Notifie.enableNotifications { enrollment ->
    check(enrollment == NotificationEnrollment.ENROLLED)
}

Use a physical device or an emulator with Google Play services, then send one test notification from Settings → Push.