4

I'm a little bit confused with the new Google Services and it's configuration files. With the latest version of the Google Play Services library we need to generate a JSON configuration file which provides service-specific information for our app and applying its gradle plugin it reads and loads that configuration file (see guide). Within that file we have something like this if we enable GCM and Analytics:

...
  "services": {
    "analytics_service": {
      "status": 2,
      "analytics_property": {
        "tracking_id": "UA-XXXXXXXX-X"
      }
    },
    "cloud_messaging_service": {
      "status": 2,
      "apns_config": []
    }
...

I have two related questions:

  1. Why do we need to put our tracking_id there if we already need it to instantiate our Analytics tracker? e.g:

    mTracker = GoogleAnalytics.getInstance(context).newTracker(R.xml.analytics_release);
    

    Where R.xml.analytics_release contains again another ga_trackingId having two references to UA-XXXXXXXX-X.

  2. In the GCM section what implies to have the status property activated (status: 2) or deactivated (status: 1)?

I don't really understand the need of this configuration file and its implications. Without it, we will get some warning messages and also having it we need to add some extra receivers in our manifest.

Community
  • 1
  • 1
GoRoS
  • 5,183
  • 2
  • 43
  • 66

0 Answers0