andling Multiple Package Names with Firebase Messaging (FCM)

This thread is here to help anyone experiencing issues with Firebase Cloud Messaging (FCM) when working with multiple package names in a single Unity project.

If you’re using multiple “apps” in FCM, it’s important to ensure that the google-services.xml file is correctly updated. While the google-services.json file may contain configurations for all package names, google-services.xml doesn’t always update automatically.

Here are some solutions to ensure the file is properly updated:

  • Manually: Make any change in the google-services.json file. The Firebase plugin will detect the change and update the google-services.xml accordingly.
  • Automatically: Write a build script that deletes the google-services.xml file before each build. This will force the Firebase plugin to regenerate it with the latest configurations.

I hope this helps anyone facing a similar situation! Feel free to share your own solutions or experiences.