[英]Android multiple firebase projects using firebase-crashlytics
Is it possible on android to programmatically initialize firebase-crashlytics SDK so it would not use the data in google-services.json ?是否可以在 android 上以编程方式初始化 firebase-crashlytics SDK 以便它不会使用 google-services.json 中的数据?
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.我问这个是因为我们使用了两个 firebase 项目,目前 google-services.json 是我们用于推送通知和 AdMob 集成的项目,我不能用我们设置的第二个项目的 google-services.json 替换它崩溃分析。
I have already tried using FirebaseOptions from my Application onCreate as follows:我已经尝试从我的应用程序 onCreate 中使用 FirebaseOptions,如下所示:
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");
So far no luck - firebase crashlytics is not properly initialized.到目前为止没有运气 - firebase crashlytics 没有正确初始化。
I got an official answer from google support - we cannot programmatically initialize firebase crashlytics.我从 google 支持部门得到了官方答复 - 我们无法以编程方式初始化 firebase crashlytics。 Ie it requires having the google services file related to the project you want to see the craslytics data for.即它需要有与您想要查看 craslytics 数据的项目相关的 google services 文件。
Therefore we would have to use a single firebase project somehow for all firebase services including admob and push.因此,我们必须以某种方式为包括 admob 和 push 在内的所有 firebase 服务使用单个 firebase 项目。
Great question.很好的问题。 You can set this up by following these steps.您可以按照以下步骤进行设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.