Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android. Firebase: Different applicationIdSuffix. Where save google-services.json?

I has project with 2 build types. Every build type has specific applicationIdSuffix.

BuildType : dev , applicationIdSuffix = .dev

BuildType : prod , applicationIdSuffix = .prod

In Firebase console I create application for build type = dev.

As result I download file google-services.json. I put it in c:\myproject\android\app\

In this file "package_name": "com.myproject.dev"

OK. It's work.

Now I in Firebase for the same project, I need to create another application with another buildType = prod.

As result I download NEW file: google-services.json. In this file "package_name": "com.myproject.prod"

Where I need to put this second file google-services.json?

like image 846
user8542613 Avatar asked Jan 30 '23 13:01

user8542613


1 Answers

Firebase already supports that, you should create a new project, then add 2 new apps for each build type (mypackage.prod and mypackage.dev) or flavor.

Once done, just export the google-services.json of the last created app (dev), the file should contain details of both apps, like the following

      "client_info": {
        "mobilesdk_app_id": "...",
        "android_client_info": {
          "package_name": "mypackage.dev"
        }
      },

      "client_info": {
        "mobilesdk_app_id": "...",
        "android_client_info": {
          "package_name": "mypackage.prod"
        }
like image 97
Mehdi Sakout Avatar answered Feb 13 '23 06:02

Mehdi Sakout