有没有可能在华为设备上创建一个重定向到华为AppGalery的firebase动态链接



我有一个基于flutter的移动应用程序,并为Google Play和Apple app Store集成了firebase动态链接。我想为我的firebase动态链接重定向设置规则。明确:

  • 如果用户来到华为品牌安卓移动设备上的firebase动态链接,他将被重定向到华为AppGalery。

  • 如果用户在不同品牌的移动设备上访问firebase动态链接,他将被重定向到Google PlayStore。

我在Firebase中找不到解决方案。是否可以使用Firebase动态链接进行重定向?

Firebase动态链接在没有GMS的华为手机上无法工作。GMS将被要求重定向到链接。因此,如果没有GMS,则无法处理到链接的重定向。

您可以在华为设备上使用App Linking。应用程序链接服务提供应用程序链接SDK。您必须将SDK集成到应用程序中,然后应用程序才能创建和接收应用程序链接的链接。

  • 如何集成App Linking SDK
  1. 集成AppGallery Connect SDK:在将应用程序链接SDK集成到您的应用程序之前,先集成AppGalleryConnect SDK和插件
  2. 启用应用程序链接服务
    1. 登录AppGallery Connect并选择我的项目
    2. 从项目列表中找到您的项目,然后单击项目卡上需要启用应用程序链接的应用程序
    3. 转到成长>应用程序链接。在显示的应用程序链接页面上,单击立即启用
  3. 集成华为分析套件:要收集应用程序链接事件的统计数据,您需要使用华为分析套件
  4. 集成应用程序链接SDK
  • 安卓工作室

将以下代码添加到应用程序目录中的build.gradle文件中(通常为app/build.gradle(,以集成应用程序链接SDK:

implementation 'com.huawei.agconnect:agconnect-applinking:1.4.0.300'
  • Eclipse

使用aar2eclipse工具将包转换为AAR包时,配置以下依赖项:

dependencies { 
embed "com.huawei.agconnect:agconnect-applinking:1.4.0.300" 
}

App Linking SDK集成后,您可以在AppGallery Connect或您的应用程序中创建App Linking的链接。

类似的问题:是否有可能在华为设备上实现Firebase动态链接?

我认为目标是首先决定您使用的是支持Google Play Services的设备,还是支持华为的设备。

当决定并在华为上链接应用程序库连接时,您可以使用华为远程配置。

注册华为控制台https://developer.huawei.com/consumer/en/agconnect/remote-configuration/

依赖项:

implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.5.2.300'
implementation 'com.huawei.hms:hianalytics:6.0.0.300'

获取配置,也许您可以将其镜像到Firebase:

config = AGConnectConfig.getInstance()
config.fetch(0) // a value of 0 here is for DEBUGGING ONLY, delete for prod (giving a 12 hour refresh period)
.addOnSuccessListener {
config.apply(it)
Log.d(TAG, "Applied")
//update based on RemoteConfig
}

参考编号:https://blog.blundellapps.co.uk/remote-configuration-using-appgallery-connect/

最新更新