@@ -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 " )
@@ -115,7 +118,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate, AppsFlyer
115118 let adjust_creative = URLQueryItem ( name: " adjust_creative " , value: paramsDictionary [ BRANCH_INIT_KEY_FEATURE] as? String )
116119 let queryItems = [ adjust_tracker, adjust_campaign, adjust_adgroup, adjust_creative]
117120 adjustUrl? . queryItems = queryItems
118- Adjust . appWillOpen ( adjustUrl? . url as URL !)
121+ if let url = adjustUrl? . url {
122+ Adjust . appWillOpen ( url)
123+ }
119124 }
120125
121126 // Deeplinking logic for use when automaticallyDisplayDeepLinkController = false
@@ -200,12 +205,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate, AppsFlyer
200205 }
201206
202207 // Respond to Universal Links
203- func application( _ application: UIApplication , continue userActivity: NSUserActivity , restorationHandler: @escaping ( [ Any ] ? ) -> Void ) -> Bool {
208+ func application( _
209+ application: UIApplication ,
210+ continue userActivity: NSUserActivity ,
211+ restorationHandler: @escaping ( [ Any ] ? ) -> Void
212+ ) -> Bool {
204213 let branchHandled = Branch . getInstance ( ) . continue ( userActivity)
205214 if ( userActivity. activityType == NSUserActivityTypeBrowsingWeb) {
206- let url = userActivity. webpageURL
207- if ( !branchHandled) {
208- Adjust . appWillOpen ( url as URL ! )
215+ if let url = userActivity. webpageURL,
216+ !branchHandled {
217+ Adjust . appWillOpen ( url)
209218 }
210219 }
211220
0 commit comments