我可以使用来自不同 google 项目的两个 google-services json 文件吗?
Can I use two google-services json files from different google projects?
我有两个 google 帐户,第一个用于通知,第二个用于 Google 登录。为了实现这两项服务,我应该在我的 android 应用程序中添加两个配置文件,但我不能那样做,因为 google 不支持。我在google里搜索过,有人推荐使用flavor,我做不到。所以我考虑合并两个 google-services.json
文件。或者我应该删除
google 个帐户之一,并在第二个帐户中创建一个新帐户。我该怎么办?
最好使用单个 google 帐户。您可以在单个帐户中同时使用 Google 登录和通知 api。
不可能,您必须选择第二个选项,您需要为不同的 google 服务使用一个 google 项目
Google 确实记录了几种支持多组 google-services.json
参数的方法,请参阅 https://firebase.google.com/docs/projects/multiprojects
根据您的要求,最好的选择可能是创建您自己的 firebase 对象 https://firebase.google.com/docs/projects/multiprojects#use_multiple_projects_in_your_application However, they explain some of the risks and limitations of having multiple sets of parameters in https://firebase.google.com/docs/projects/multiprojects#reliable-analytics
他们还提供了有关文件处理方式的有用文档https://developers.google.com/android/guides/google-services-plugin#processing_the_json_file,这可能对您有所帮助,尤其是当您决定合并多个 google-services.json
文件的内容时。
出于兴趣,您最终采用了什么方法?
我有两个 google 帐户,第一个用于通知,第二个用于 Google 登录。为了实现这两项服务,我应该在我的 android 应用程序中添加两个配置文件,但我不能那样做,因为 google 不支持。我在google里搜索过,有人推荐使用flavor,我做不到。所以我考虑合并两个 google-services.json
文件。或者我应该删除
google 个帐户之一,并在第二个帐户中创建一个新帐户。我该怎么办?
最好使用单个 google 帐户。您可以在单个帐户中同时使用 Google 登录和通知 api。
不可能,您必须选择第二个选项,您需要为不同的 google 服务使用一个 google 项目
Google 确实记录了几种支持多组 google-services.json
参数的方法,请参阅 https://firebase.google.com/docs/projects/multiprojects
根据您的要求,最好的选择可能是创建您自己的 firebase 对象 https://firebase.google.com/docs/projects/multiprojects#use_multiple_projects_in_your_application However, they explain some of the risks and limitations of having multiple sets of parameters in https://firebase.google.com/docs/projects/multiprojects#reliable-analytics
他们还提供了有关文件处理方式的有用文档https://developers.google.com/android/guides/google-services-plugin#processing_the_json_file,这可能对您有所帮助,尤其是当您决定合并多个 google-services.json
文件的内容时。
出于兴趣,您最终采用了什么方法?