我與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