FCM Setup

Firebase Cloud Messaging Setup for Android

Push Notifications ended with BookNest crashing on register(): "Default FirebaseApp is not initialized". The Capacitor 243,123 push guide's steps (they need a Google account and were not run here):

  1. In the Firebase 1 console, create a project and add an Android app with the package name com.example.booknest, the appId.

  2. Download google-services.json into android/app/ and rebuild: app/build.gradle applies the Google Services plugin (4.4.4, already on the classpath) only when that file exists.

  3. On iOS, upload an APNs key to Firebase and enable the Push Notifications capability in Xcode 10 .

The mechanism can be run with a placeholder file: a made-up project and a well-formed but invalid API key. The build then ran :app:processDebugGoogleServices ("Parsing json file: .../android/app/google-services.json") and generated values.xml resources such as project_id = booknest-placeholder. With that APK, the lab's Push button (Push Notifications) got through register(), and the error arrived as an event instead of a crash:

The push registration in logcatShell
adb -s emulator-5558 logcat -d -v tag | grep -E "LAB (push|registration)|FirebaseMessaging"
Output
I/Capacitor/Console: File: https://localhost/assets/index-DhLuYZTA.js - Line 1011 - Msg: LAB
  push {"receive":"granted"}
E/FirebaseMessaging: Failed to get FIS auth token
...
E/FirebaseMessaging: Topic sync or token retrieval failed on hard failure exceptions:
  java.util.concurrent.ExecutionException: java.io.IOException: FIS_AUTH_ERROR. Won't retry
    the operation.
I/Capacitor/Console: File: https://localhost/assets/index-DhLuYZTA.js - Line 1011 - Msg: LAB
  registrationError "java.util.concurrent.ExecutionException: java.io.IOException:
    FIS_AUTH_ERROR"

Firebase Installations ("Service is unavailable") could not register the app with the made-up project. With a real file the same call fires registration with the device's FCM token, which your server stores per user. The placeholder was removed after the test; BookNest still needs a real project.