Is it possible to use Firebase Messaging with Goog

2019-02-09 02:53发布

问题:

I started using Firebase Cloud Messaging for an Android app and now I'm trying to add Google Analytics (not Firebase analytics) to the same app.

The problem is that when creating google-services.json for Analytics, it ignores FCM. I'm using the same google account to create both json files.

I read that when enabling the second service (in this case Analytics) the json should update adding both Messaging and Analytics but maybe this only works within Firebase services?

I could use Firebase Analytics and actually that's what Google recommends, but is it possible to use both Google Analytics with Firebase services?

回答1:

Yes, it is possible to use Firebase Cloud Messaging and Google Analytics in the same app. I would suggest using the json file generated by Firebase and merging in the following object into the "services" object :

 "analytics_service": {
          "status": 2,
          "analytics_property": {
            "tracking_id": "<your tracking id>"
          }
        },