@@ -75,7 +75,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate, AppsFlyer
7575
7676 // Required. Initialize session. automaticallyDisplayDeepLinkController is optional (default is false).
7777
78- branch. initSession ( launchOptions: launchOptions, automaticallyDisplayDeepLinkController: false , deepLinkHandler: { params, error in
78+ branch. initSession (
79+ launchOptions: launchOptions,
80+ automaticallyDisplayDeepLinkController: false ,
81+ deepLinkHandler: { params, error in
7982
8083 defer {
8184 let notificationName = Notification . Name ( " BranchCallbackCompleted " )
@@ -98,14 +101,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate, AppsFlyer
98101 if clickedBranchLink {
99102 let nc = self . window!. rootViewController as! UINavigationController
100103 let storyboard = UIStoryboard ( name: " Content " , bundle: nil )
101- let contentViewController = storyboard. instantiateViewController ( withIdentifier: " Content " ) as! ContentViewController
104+ let contentViewController = storyboard. instantiateViewController (
105+ withIdentifier: " Content "
106+ ) as! ContentViewController
102107 nc. pushViewController ( contentViewController, animated: true )
103108
104- let referringLink = paramsDictionary [ " ~referring_link " ] as! String
105- let content = String ( format: " \n Referring link: \( referringLink) \n \n Session Details: \n \( paramsDictionary. JSONDescription ( ) ) " )
109+ let referringLink = paramsDictionary [ " ~referring_link " ] as? String
110+ let content = String (
111+ format: " \n Referring link: \( referringLink ?? " <nil> " ) " +
112+ " \n \n Session Details: \n \( paramsDictionary. JSONDescription ( ) ) "
113+ )
106114 contentViewController. content = content
107115 contentViewController. contentType = " Content "
108116 }
117+
109118 } else {
110119 print ( String ( format: " Branch TestBed: Finished init with params \n %@ " , paramsDictionary. description) )
111120 }
0 commit comments