@@ -294,6 +294,7 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
294294 let campaignNotificationDic = getCampaignContent ( response. notification. request. content. userInfo)
295295 sendActivity ( BreinActivityType . OPEN_PUSH_NOTIFICATION. rawValue, additionalActivityTagContent: campaignNotificationDic)
296296
297+ BreinLogger . shared. log ( " Breinify invoking handleIncomingNotificationContent from didReceive method " )
297298 handleIncomingNotificationContent ( response. notification. request. content. userInfo)
298299
299300 completionHandler ( )
@@ -318,14 +319,14 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
318319 let campaignNotificationDic = getCampaignContent ( userInfo)
319320 sendActivity ( BreinActivityType . RECEIVED_PUSH_NOTIFICATION. rawValue, additionalActivityTagContent: campaignNotificationDic)
320321 }
321-
322322 }
323323
324324 private func handleIncomingNotificationContent( _ notification: [ AnyHashable : Any ] ) {
325325 BreinLogger . shared. log ( " Breinify handleIncomingNotificationContent invoked with notification: \( notification) " )
326326
327327 let actionNotificationDic = getActionContent ( notification)
328328 guard let unwrappedDic = actionNotificationDic else {
329+ BreinLogger . shared. log ( " Breinify handleIncomingNotificationContent - no action content detected on: \( notification) " )
329330 return
330331 }
331332
@@ -335,26 +336,30 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
335336 BreinLogger . shared. log ( " Breinify action: \( action) with parameter: \( parameter) " )
336337
337338 if action == " openUrl " {
339+ BreinLogger . shared. log ( " Breinify openUrl action detected " )
338340 let sharedSelector = NSSelectorFromString ( " sharedApplication " )
339341 let openSelector = NSSelectorFromString ( " openURL: " )
340342
341343 let urlStr = getUrl ( parameter)
342344 if urlStr. isEmpty == false {
343-
345+ BreinLogger . shared . log ( " Breinify trying to open url: \( urlStr ) " )
344346 DispatchQueue . main. async {
345347 if let urlToOpen = URL ( string: urlStr) , UIApplication . responds ( to: sharedSelector) ,
346348 let shared = UIApplication . perform ( sharedSelector) ? . takeRetainedValue ( ) as? UIApplication , shared. responds ( to: openSelector) {
349+ BreinLogger . shared. log ( " Breinify performing action - urlToOpen is: \( urlToOpen) " )
347350 shared. perform ( openSelector, with: urlToOpen)
348351 }
349352 }
350353 }
351354 } else if action == " sendActivity " {
355+ BreinLogger . shared. log ( " Breinify sendActivity action detected " )
352356 // send activity
353357 let activityName = getActivityName ( parameter)
354358 if activityName. isEmpty == false {
355359 let tags = getTags ( parameter)
356360 if tags? . isEmpty == false {
357361 // send the activity
362+ BreinLogger . shared. log ( " Breinify sending action detected with name: \( activityName) and tags: \( tags) " )
358363 BreinifyManager . shared. sendActivity ( activityName, additionalActivityTagContent: tags)
359364 }
360365 }
@@ -656,7 +661,6 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
656661 let campaignNotificationDic = getCampaignContent ( notification)
657662 sendActivity ( BreinActivityType . RECEIVED_PUSH_NOTIFICATION. rawValue, additionalActivityTagContent: campaignNotificationDic)
658663 }
659-
660664 }
661665
662666 /// Provides the campaign related content as a dictionary
@@ -688,7 +692,7 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
688692 notiDic? . forEach {
689693 let key = ( $0) . lowercased ( )
690694 if key. contains ( " breinify " ) {
691- BreinLogger . shared. log ( " Breinify Tag detected in notification " )
695+ BreinLogger . shared. log ( " Breinify Tag detected in notification for content: \( content ) " )
692696 if let innerValue = ( $1) as? String {
693697
694698 let innerDic = BreinUtil . convertToDictionary ( text: innerValue)
@@ -698,11 +702,10 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
698702 if key. contains ( content) {
699703 if let contentDic = val as? Dictionary < String , Any > {
700704 retVal = contentDic
701- BreinLogger . shared. log ( " Breinify content is \( contentDic) " )
705+ BreinLogger . shared. log ( " Breinify content ( \( content ) ) is \( contentDic) " )
702706 }
703707 }
704708 }
705-
706709 }
707710 }
708711 }
@@ -712,8 +715,6 @@ open class BreinifyManager: NSObject, UNUserNotificationCenterDelegate {
712715
713716 }
714717
715-
716-
717718 public func didFailToRegisterForRemoteNotificationsWithError( _ error: Error ) {
718719 BreinLogger . shared. log ( " Breinify didFailToRegisterForRemoteNotificationsWithError called " )
719720 }
0 commit comments