是否可以在 Android 中使用 Firebase Messaging 和 Google Analytics?

2023-07-29移动开发问题
8

本文介绍了是否可以在 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何在 COCOS2d Android 中使用 CClistview?
How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)...
2024-08-12 移动开发问题
5

cocos2d-android:如何显示分数
cocos2d-android: how to display score(cocos2d-android:如何显示分数)...
2024-08-11 移动开发问题
7

Sqlite 数据库未从资产文件夹 Android 复制
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)...
2024-04-15 移动开发问题
8

SQLite 数据库副本在由设备而不是模拟器生成时出现损坏
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)...
2024-04-15 移动开发问题
4

安卓文件拷贝
Android file copy(安卓文件拷贝)...
2024-04-15 移动开发问题
6

Android如何在android中检测Edittext的Copy事件
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)...
2024-04-15 移动开发问题
5