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也登錄後,意味着該怎麼做。 –