【发布时间】:2018-07-30 12:30:15
【问题描述】:
我的 iOS 应用出现动态链接问题。
场景:用户请求忘记密码邮件 -> 收到带有动态链接的邮件
iPhone A:动态链接正确打开应用
iPhone B:动态链接打开带有“打开”按钮的 Firebase 重定向页面
我一直在研究的内容:
- 应用版本相同
- iOS版本相同
- 用户帐号相同
- apple-app-site-association 文件显示正确的 appID
- ?d=1 调试显示错误适用于 Android 和网络钓鱼,但不适用于 iOS
- DynamicLinks.performDiagnostics(completion: nil) 说:performDiagnostic 成功完成!未发现错误。
这种不一致使得几乎不可能再调试这个问题。
有没有人知道如何研究/调试这个问题,甚至更好地解决这个问题?提前非常感谢!
来自 AppDelegate 的用于配置 Firebase 的代码:
// Configure Firebase
#if PRODUCTION
let GoogleServiceName = "GoogleService-Info"
#elseif ACCEPTANCE
let GoogleServiceName = "GoogleService-Info-Acceptance"
#else
let GoogleServiceName = "GoogleService-Info-Development"
#endif
let filePath = Bundle.main.path(forResource: GoogleServiceName, ofType: "plist")
guard let fileopts = FirebaseOptions(contentsOfFile: filePath!)
else {
assert(false, "Couldn't load config file")
return false
}
#if PRODUCTION
fileopts.deepLinkURLScheme = "***-production"
#elseif ACCEPTANCE
fileopts.deepLinkURLScheme = "***-acceptance"
#else
fileopts.deepLinkURLScheme = "***-development"
#endif
FirebaseApp.configure(options: fileopts)
Firebase 诊断调试:
---- Firebase Dynamic Links diagnostic output start ----
Firebase Dynamic Links framework version 3.0.1
System information: OS iOS, OS version 11.4, model iPhone
Current date 2018-07-30 11:28:41 +0000
Device locale en-US (raw en_US), timezone Europe/Amsterdam
WARNING: iOS Simulator does not support Universal Links. Firebase Dynamic Links SDK functionality will be limited. Some FDL features may be missing or will not work correctly.
Specified custom URL scheme is ***-acceptance and Info.plist contains such scheme in CFBundleURLTypes key.
performDiagnostic completed successfully! No errors found.
---- Firebase Dynamic Links diagnostic output end ----
【问题讨论】:
-
日志中提到了模拟器——你是在不同的模拟版本上看到的,还是在不同的物理设备上看到的?如果不是,请检查几件事:它是否是相同版本的应用程序(例如,如果一个是产品版本,一个是开发人员或类似版本?它是否仍在发生,例如设备上是否存在缓存的应用程序关联文件?跨度>
-
@IanBarber 我发现用户可以禁用通用链接,请参阅link。
标签: ios swift firebase firebase-dynamic-links