我使用Firebase Dynamiclink进行跟踪。但是,每次我单击链接时,即使再次单击相同的链接,事件也会触发为dynamic_link_first_open
。
我的FirebaseCore是5.1.9,而FirebaseDynamicLinks是3.3.0。
这是我的代码。
@available(iOS 9.0, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
return application(app, open: url,
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String,
annotation: "")
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
// Handle the link
return true
}
return false
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
let _ = DynamicLinks.dynamicLinks().handleUniversalLink(incomingUrl, completion: {
(dynamiclink, error) in
if let _ = dynamiclink?.url {
// Handle the link
}
})
}
dynamic_link事件如何在first_open和app_open之间分类?