我与AppFlayer SDK和通用链接的深层链接成功打开应用程序意味着深入链接正常工作。当应用程序从链接打开时,appflayer的深度链接不工作(代理方法未调用)
现在的问题是,当应用程序打开链接时,它不会重定向到它的页面。但是,如果我把应用程序在后台,并采取在前台,然后deeplinking作品
我遵循这一指导线。(link)
AppFlayer设置代码
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
AppsFlyerTracker.shared().appsFlyerDevKey = "xxxxxxxxxxxx"
AppsFlyerTracker.shared().appleAppID = "xxxxxxx"
AppsFlyerTracker.shared().isDebug = false
AppsFlyerTracker.shared().delegate = self
self.pushNotificationService(application)
objStoryBoard = UIStoryboard(name:"Main", bundle: nil)
return true
}
AppFlayer代表
编辑::此方法不被调用时应用程序是从appsflayer的链路开放营销应用的
//MARK:
//MARK: appflayer delegate
func onAppOpenAttribution(_ installData: [AnyHashable: Any]) {
NSLog("installData ::%@", installData)
if let link = installData["link"] as? String
{
if link.contains(read_Localizable("titleAppflayer"))
{
if let arrQueryItems = URLComponents(string: link)!.queryItems {
for obj in arrQueryItems {
if obj.name.caseInsensitiveCompare(read_Localizable("appflayerParameter")) == .orderedSame
{
self.redirectAppflayer(withstrUrl: obj.value!)
return
}
}
}
}
}
}
用户活动的方法
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
// if let url = userActivity.webpageURL
// {
// NSLog("URL :: %@",[url])
// }
if userActivity.webpageURL?.absoluteString.contains(read_Localizable("titleAppflayer")) == true
{
AppsFlyerTracker.shared().continue(userActivity, restorationHandler: restorationHandler)
return true
}
return Branch.getInstance().continue(userActivity)
}
让我知道我做错了。
你是什么意思'..它不会重定向到它的页面。 –
@MaximShoustin对不起我的坏。我的意思是需要在特定位置重定向 –
为什么不使用[Branch](http://branch.io)SDK在打开时执行深度链接。你可以在'application:didFinishLaunchingWithOptions:'中执行你的路由,我相信你应该使用AppsFlyer – clayjones94