【发布时间】:2019-11-18 16:58:37
【问题描述】:
当我的应用没有安装,我先安装我的应用,安装后可以得到动态链接。
但是当我的应用已经安装后,我的应用直接启动了,但是我获取不到动态链接。
我的应用安装后如何获取动态链接网址?
这是我的快速代码(AppDelegate.swift)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any] = [:]) -> Bool {
// dynamic link
if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
// Handle the deep link. For example, show the deep-linked content or
// apply a promotional offer to the user's account.
// ...
handleIncoingDynamicLink(dynamicLink) //<-not fired
return true
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
// Handle the deep link. For example, show the deep-linked content or
// apply a promotional offer to the user's account.
// ...
print(dynamicLink) //<-- not fired
handleIncoingDynamicLink(dynamicLink)
return true
}
let handled: Bool = ApplicationDelegate.shared.application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
return handled
}
【问题讨论】:
标签: ios swift firebase firebase-dynamic-links