Reconcile google-services.json in detached project

#1

Hello!

When I detached my expo app (from SDK 29), I ended up with the following google-services.json file

{
  "project_info": {
    "project_id": "exponent-5d",
    "project_number": "367311374693",
    "name": "Exponent Play Services"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:313315174693:android:f968efbb41daxa7a",
        "client_id": "android:host.exp.exponent",
        "client_type": 1,
        "android_client_info": {
          "package_name": "com.pkg.min",
          "certificate_hash": ""
        }
      },
      "oauth_client": [],
      "api_key": [
        {
          "current_key": ""
        }
      ],
      "services": {
        "analytics_service": {
          "status": 2,
          "analytics_property": {
            "tracking_id": "UA-76671108-1"
          }
        },
        "cloud_messaging_service": {
          "status": 2,
          "apns_config": []
        },
        "appinvite_service": {
          "status": 1,
          "other_platform_oauth_client": []
        },
        "google_signin_service": {
          "status": 1
        },
        "ads_service": {
          "status": 1
        }
      }
    }
  ],
  "client_info": [],
  "ARTIFACT_VERSION": "1"
}

My reason for detaching is that I need to integrate push notifications through a non-expo service. So I am trying to set up Firebase Cloud Messaging (FCM) for android app right now, and I am not sure how to reconcile the google-services.json file given to me by FCM:

{
  "project_info": {
    "project_number": "103268334012",
    "firebase_url": "https://min-pkg.firebaseio.com",
    "project_id": "min-pkg",
    "storage_bucket": "min-pkg.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:103262344012:android:1d25f4251c1c7891",
        "android_client_info": {
          "package_name": "com.pkg.min"
        }
      },
      "oauth_client": [
        {
          "client_id": "103268544012-cn496fhhvc6pfq87ko0lh02.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyA0a7IT0hTBluiH_3vHr5HzjpEU"
        }
      ],
      "services": {
        "analytics_service": {
          "status": 1
        },
        "appinvite_service": {
          "status": 1,
          "other_platform_oauth_client": []
        },
        "ads_service": {
          "status": 2
        }
      }
    }
  ],
  "configuration_version": "1"
}

I am not sure what might break if I overwrite it or how these keys play into my detached expo app. I figure I can safely replace project info with the updated firebase project info. The client key takes an array, but I dont think I can just append on the firebase client info based on this snippet from the google-services docs:

So I guess questions I have on merging this:

  1. What does mobilesdk_app_id do?
  2. Can I replace the project_info key?
  3. What is the analytics_service? I don’t remember setting up any tracking in my app.
#2

I can’t answer your exact questions, but I’ve replaced the entire google-services.json with what I downloaded from the Firebase console when adding FCM, and so far, so good (I just did this the other day and nothing broke in basic testing- don’t have an app in the wild like this yet).

closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.