我已经在我的iOS项目中添加了branch.io sdk。我有一个可以正常工作的自定义URL方案,我添加了通用应用链接,可以正常工作。
现在,我在仪表板iOS应用程序中启用了我的自定义URL方案,用于下载应用程序的自定义URL,应用程序前缀和捆绑识别符。
在"快速链接"部分中,我创建了一个快速链接女巫,有一个[键":" value")对的深链接部分,并再次向我的詹金斯添加了一个重定向,可以下载IPA。
现在,如果我通过移动野生动物园中的复制/粘贴访问该链接,未安装该应用程序,我将正确地带到Jenkins。
此时,我从Xcode运行该应用
branch = Branch.getInstance()
branch.initSession(launchOptions: launchOptions, andRegisterDeepLinkHandler: {params, error in
if error == nil {
// params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
// params will be empty if no data found
// ... insert custom logic here ...
print("params: %@", params as? [String: AnyObject] ?? {})
} else {
print(error?.localizedDescription ?? "")
}
})
这里的问题始终只包含两个参数:
params: %@ ["+clicked_branch_link": 0, "+is_first_session": 0]
我也实现了
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
let branchHandled = branch.application(application,
open: url,
sourceApplication: sourceApplication,
annotation: annotation
)
if (!branchHandled) {
// If not handled by Branch, do other deep link routing for the Facebook SDK, Pinterest SDK, etc
var handled = false
handled = //this is Facebook handling
guard handled == false else { return true }
} else {
// do some stuff if it's coming from branch
}
return branchHandled
}
我的兴趣是要使分支通过我的[key':" value"]对,以便在这一点上像深链路一样处理它,但我不知道该尝试什么。
递延深链接的失败可能是由于特定分支应用程序的分支密钥和分支链接不匹配。验证用于递延深链接的分支链接是使用Info.plist中使用的同一分支密钥生成的。