当用户导航到 appStore 并首次下载时,DynamicLink 深层链接 url 为零

Ian*_*an 5 dynamic-links firebase firebase-dynamic-links

我尝试在 Firebase 控制台创建动态链接,以导航用户在 appStore 下载我的应用程序,当他们第一次启动应用程序时,我不断获取带有 nil url 的 DynamicLink 对象。

 func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

      if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
            //  dynamicLink url is nil 
      }
}
Run Code Online (Sandbox Code Playgroud)
<FIRDynamicLink: 0x281ad2a40, url [(null)], match type: none, minimumAppVersion: N/A, match message: (null)>
Run Code Online (Sandbox Code Playgroud)

网址是

MyAppSchema://google/link/?dismiss=1&is_weak_match=1
Run Code Online (Sandbox Code Playgroud)

当我进行诊断时我得到了这个


---- Firebase Dynamic Links diagnostic output start ----
Firebase Dynamic Links framework version 3.0.1
System information: OS iOS, OS version 12.1.4, model iPhone
Current date 2019-03-28 10:10:21 +0000
Device locale en-US (raw en_US), timezone Asia/Taipei
    Specified custom URL scheme is {MyAppSchema} and Info.plist contains such scheme in CFBundleURLTypes key.
    AppID Prefix: {AppID Prefix}, Team ID: {teamID}, AppId Prefix equal to Team ID: YES
performDiagnostic completed successfully! No errors found.
---- Firebase Dynamic Links diagnostic output end ----
Run Code Online (Sandbox Code Playgroud)

已尝试/确认:

  1. 不使用 Safari 私人模式
  2. 短链接/长链接
  3. 应用程序未安装
  4. 切换首选语言/区域/区域设置
  5. 预览页面已启用
  6. 无线网络和蜂窝网络

我在 Firebase iOS SDK 存储库中提出了一个问题

https://github.com/firebase/firebase-ios-sdk/issues/2666

重现步骤:

  1. 应用程序未安装
  2. 单击动态链接
  3. 预览页面
  4. 应用商店页面
  5. 从 Xcode 构建到设备
  6. 获取 DynamicLink 对象但 url 为 nil

期望第 6 步获取 url

Ric*_*tes 1

所以我已经挣扎了很长一段时间了,而且在您目前所处的情况下,所有步骤都已按照与文档类似的方式进行,并且调试显示它没有错误。

今晚我终于想通了,或者应该说是 2020 年新年还有 14 分钟!我所需要的只是在 google api 控制台中启用动态链接。为什么这根本没有记录。

这是链接! https://console.developers.google.com/apis/api/firebasedynamiclinks.googleapis.com/overview