iOS 上的 Firebase 动态链接有时会失败
Firebase Dynamic Links on iOS sometimes fails
我的 iOS 应用程序出现动态 Link 问题。
场景:用户请求忘记密码邮件 -> 收到动态邮件 link
iPhone A: 动态 link 正确打开应用程序
iPhone B: 动态 link 使用“打开”按钮打开 Firebase 重定向页面
我一直在研究的内容:
- app版本相同
- iOS版本相同
- 用户账号相同
- apple-app-site-association 文件显示正确的 appID
- ?d=1 调试显示 Android 和钓鱼错误,但 iOS
没有
- DynamicLinks.performDiagnostics(completion: nil) 说:performDiagnostic 成功完成!没有发现错误。
这种不一致使得几乎不可能再调试这个问题。
有没有人知道如何 research/debug 更好地解决这个问题?非常感谢!
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 ----
对于那些最终来到这里的人,我发现了它是什么:
这不是代码或配置问题,但显然用户可以禁用每个设备和每个应用程序的通用链接,这将在重新安装后持续存在。完整的答案可以在这里找到:
我的 iOS 应用程序出现动态 Link 问题。
场景:用户请求忘记密码邮件 -> 收到动态邮件 link
iPhone A: 动态 link 正确打开应用程序
iPhone B: 动态 link 使用“打开”按钮打开 Firebase 重定向页面
我一直在研究的内容:
- app版本相同
- iOS版本相同
- 用户账号相同
- apple-app-site-association 文件显示正确的 appID
- ?d=1 调试显示 Android 和钓鱼错误,但 iOS 没有
- DynamicLinks.performDiagnostics(completion: nil) 说:performDiagnostic 成功完成!没有发现错误。
这种不一致使得几乎不可能再调试这个问题。
有没有人知道如何 research/debug 更好地解决这个问题?非常感谢!
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 ----
对于那些最终来到这里的人,我发现了它是什么:
这不是代码或配置问题,但显然用户可以禁用每个设备和每个应用程序的通用链接,这将在重新安装后持续存在。完整的答案可以在这里找到: