1
点击邀请链接后,我正在使用分支将用户重定向到我的应用的特定视图。它的工作原理除了我需要他们在他们登录后才重定向,而不是像现在这样。 从我能告诉我没有方法在我的初始视图控制器被点击分支链接后调用,所有的设置都必须在AppDelegate上完成。 下面是一些我的AppDelegate相关的代码:只有在用户登录后才能重定向Branch.io
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Branch.getInstance().initSession(launchOptions: launchOptions, andRegisterDeepLinkHandler: { params, error in
guard error == nil else { return }
guard let userDidClick = params["+clicked_branch_link"] as? Bool else { return }
if userDidClick {
let branch = Branch.getInstance()
branch?.initSession(launchOptions: launchOptions, andRegisterDeepLinkHandler: { params, error in
if error == nil {
var controller = UIStoryboard.init(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "DetailViewController")
branch?.registerDeepLinkController(controller, forKey: "valid_link")
branch?.initSession(launchOptions: launchOptions, automaticallyDisplayDeepLinkController: true)
print("prm: \(params)")
}
}) }
})
...
,像它应该,但我需要它后才可登录重定向重定向到DetailViewController。 感谢您提前提供任何帮助。
能否请您详细说明与任何样品或解释你的答案。 –
没有OP的认证流程的完整细节,没有。查看通用方法的更新回答 –
感谢您的帮助到目前为止,您可以请代码帮助我viewController也登录后,意味着该怎么做。 –