是否可以在华为设备上实施 Firebase 动态链接?

Is it possible to implement Firebase Dynamic Links on Huawei devices?

我创建了 android 使用动态链接的应用程序

FirebaseApp.initializeApp(context)
Firebase.dynamicLinks
  .getDynamicLink(intent)
  .addOnSuccessListener(context) { successFunction(it) }
  .addOnFailureListener(context) { failureFunction(it) }

implementation 'com.google.firebase:firebase-dynamic-links-ktx:19.1.0'
implementation 'com.google.firebase:firebase-analytics:17.3.0'

我找到了HMS Core将firebase-analytics代理到华为设备的教程: https://developer.huawei.com/consumer/en/doc/development/Tools-Guides/30935655 但是根本没有关于 firebase-dynamic-links

的信息

是否有可能在最新的华为设备上使用 Firebase 动态链接?

没有。 Firebase 正式依赖于 Google Play 服务。您不应期望任何 Firebase 服务都能在没有 Google Play 服务的手机上运行。即使某些 Firebase 服务目前确实可以正常工作,它们也可以随时停止工作,恕不另行通知并破坏您的应用程序。

在我看来,您应该将所有 Firebase 服务视为无法在没有 Google Play 服务的手机上运行。试图寻找黑客和解决方法只会导致以后难以调试问题。

纯华为设备(华为 P40)你不能使用 Firebase Dynamic Links,而不是 Firebase Dynamic Link 你可以在华为设备上使用 "App Linking" or third party kits。 他们也有样品 code

在没有GMS的华为手机上,开发者可以尝试使用app linking来实现同样的功能: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-applinking-introduction

Firebase 动态链接无法在没有 GMS 的手机上运行。

将调用 GMS 以重定向到 link。因此,如果没有 GMS,则无法处理重定向到 link。

您可以在华为设备上使用App Linking

截至日期(2020 年 10 月 20 日),Firebase 不支持 link 华为应用程序库,因为 Firebase 依赖于 Google Play 服务,该服务在最新的华为设备上受到限制。

另一方面,华为App Linking服务支持HMS(华为)、GMS(Google)以及iOS平台。 iOS 支持目前处于 Beta 阶段,所以我们应该很快就会看到它的最终版本。

所有这些都意味着与 Firebase 动态链接(仅 GMS 和 iOS)相比,华为 App Links 具有更多的覆盖范围(GMS、HMS、iOS)。

进一步补充,branch.io(第 3 部分提供商,也在另一个答案中提及)支持所有这些平台 - GMS、HMS、iOS。

我很晚才回答这个问题,但我今天在使用 firebase 动态链接开发 Ionic 应用程序时遇到了这个问题。 由于华为设备可能不支持 google-服务。所以我刚刚下载了 Google Play 商店,动态应用运行良好/

Download Google Play Store (This will help in working with Google services and firebase Dynamic link will work perfectly).