Firebase和Google Play服务之间使用哪些依赖项?

时间:2016-07-31 20:46:17

标签: android firebase google-play-services

我最近开始玩Firebase,但我无法完全理解它与Google Play服务的关系。我知道Firebase是一个移动平台,在Android上它基于Google Play服务,但为什么有一些模块与Google Play服务的名称相同?

例如,在我的build.gradle我可以:

com.google.android.gms:play-services-auth:9.4.0
com.google.android.gms:play-services-ads:9.4.0

但也是:

com.google.firebase:firebase-auth:9.4.0
com.google.firebase:firebase-ads:9.4.0

我在Firebase documentation上看到有可用组件列表(请注意,最后一个组件实际上是Google Play服务模块):

com.google.android.gms:play-services-appindexing:9.4.0

same list for Google Play Services要长得多,因此某些模块仅使用Firebase依赖项无法使用。我应该使用哪些依赖项?为什么?我可以使用混合依赖吗?

1 个答案:

答案 0 :(得分:0)

在这个新的Firebase(从5月18日起),Google为其添加了一些现有服务。 Google Play服务已经拥有以下功能:Google Analytics,AdMob,测试实验室等。您可以在Google Developer Console中使用它们。

然而,他们决定将其中一些功能与firebase合并。这样,您就可以在Firebase控制台上“一起”使用所有功能。它们现已统一,为您的用户提供更好的体验,并帮助您(作为开发人员)轻松管理您的项目。

因此,如果要使用firebase,则应使用firebase依赖项。 Google Play依赖项适用于在Google Developer Console上创建的项目。