简体   繁体   中英

Different Firebase projects for Flutter

I have two firebase projects for my Flutter app, a prod version and staging version. I have added my Android and iOS apps to both projects. The Android package name and iOS bundle ID are identical for all versions (Android production, Android staging, iOS production, iOS staging).

I have the following problem. On Android, I added the production app to the production firebase project first. I added the google-services.json file and everything was working properly. The active users were reflected in analytics and test cloud messages were arriving to the appropriate devices.

Then I added the Android app to the staging firebase project. I downloaded the google-services.json file for the staging firebase project and swapped it in place in the android/app directory. For now, the only difference between the Android production app and the staging app is the google-services.json file. Once I did this, firebase was not working for the staging app. The active users were not reflected in analytics and the test cloud messages (whose FCM tokens were of course different not) were not arriving. What's interesting is that sending test cloud messages to these new tokens from the production project was working!

Does anyone know what the problem could be? Is it okay if both iOS and Android have identical package names/bundle IDs for two different firebase projects? Am I forgetting something in the configuration? Thanks.

I would suggest you link only 1 app per Firebase Project and vice-versa.

What you can do is use the Emulators for Staging.

Here are the references -

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM