Is it possible to use Firebase Messaging with Google Analytics in Android?(是否可以在 Android 中使用 Firebase Messaging 和 Google Analytics?)
问题描述
我开始将 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以在 Android 中使用 Firebase Messaging 和 Google Analytics?
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iOS4 创建后台定时器 2022-01-01
