我开始将 Firebase Cloud Messaging 用于 Android 应用,现在我尝试将 Google Analytics(不是 Firebase 分析)添加到同一个应用.
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.
问题在于,在为 Analytics 创建 google-services.json 时,它会忽略 FCM.我使用同一个谷歌帐户来创建两个 json 文件.
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.
我读到在启用第二个服务(在本例中为 Analytics)时,json 应该更新添加消息传递和分析,但也许这只适用于 Firebase 服务?
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?
我可以使用 Firebase Analytics,实际上这是 Google 推荐的,但是否可以同时使用 Google Analytics 和 Firebase 服务?
I could use Firebase Analytics and actually that's what Google recommends, but is it possible to use both Google Analytics with Firebase services?
是的,可以在同一个应用程序中使用 Firebase Cloud Messaging 和 Google Analytics.我建议使用 Firebase 生成的 json 文件并将以下对象合并到服务"对象中:
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>"
}
},
这篇关于是否可以在 Android 中使用 Firebase Messaging 和 Google Analytics?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!