我尝试在 Firebase 控制台创建 dynamicLink 以导航用户在 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
}
}
<FIRDynamicLink: 0x281ad2a40, url [(null)], match type: none, minimumAppVersion: N/A, match message: (null)>
网址是
MyAppSchema://google/link/?dismiss=1&is_weak_match=1
当我执行诊断时,我得到了这个
---- 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 ----
已尝试/确认:
- 不使用 Safari 私人模式
- 短链接/长链接
- 未安装应用程序
- 切换首选语言/区域/语言环境
- 启用预览页面
- wifi 和蜂窝网络
我在 Firebase iOS SDK 存储库中打开了一个问题
https://github.com/firebase/firebase-ios-sdk/issues/2666
重现步骤:
- 未安装应用程序
- 点击动态链接
- 预览页面
- 应用商店页面
- 从 Xcode 构建到设备
- 获取 DynamicLink 对象但 url 为 nil
期望第 6 步得到 url