Android使用firebase-crashlytics的多个Firebase项目 [英] Android multiple firebase projects using firebase-crashlytics
问题描述
Android上是否可以通过编程方式初始化firebase-crashlytics SDK,从而不使用google-services.json中的数据?
Is it possible on android to programmatically initialize firebase-crashlytics SDK so it would not use the data in google-services.json ?
我之所以这样问是因为我们使用了两个Firebase项目,并且当前google-services.json是我们用于Push通知和AdMob集成的项目,而我不能将其替换为我们拥有的第二个项目的google-services.json为crashlytics设置.
I am asking this because we use two firebase projects and currently google-services.json is of the project we use for Push notifications and AdMob integration, and I cannot replace it with google-services.json of the second project we have set up for crashlytics.
我已经尝试从我的应用程序onCreate中使用FirebaseOptions,如下所示:
I have already tried using FirebaseOptions from my Application onCreate as follows:
FirebaseOptions options = new FirebaseOptions.Builder()
.setApplicationId("firebase_crashlytics_application_id")
.setApiKey("firebase_crashlytics_api_key")
.setProjectId("firebase_crashlytics_project_id")
.build();
FirebaseApp.initializeApp(this, options, "crashlytics");
到目前为止没有运气-Firebase crashlytics没有正确初始化.
So far no luck - firebase crashlytics is not properly initialized.
推荐答案
我从Google支持部门获得了官方答复-我们无法以编程方式初始化firebase crashlytics.IE.它需要具有与您要查看其craslytics数据的项目相关的google services文件.
I got an official answer from google support - we cannot programmatically initialize firebase crashlytics. I.e. it requires having the google services file related to the project you want to see the craslytics data for.
因此,我们必须以某种方式将单个firebase项目用于包括admob和push在内的所有firebase服务.
Therefore we would have to use a single firebase project somehow for all firebase services including admob and push.
这篇关于Android使用firebase-crashlytics的多个Firebase项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!