Tapping on push notification not enter in didReceiveNotification delegate function after integrating ClaverTap SDk


#1

I added ClaverTap SDK and integrate into my AppDelegate.swift file using:

CleverTap.autoIntegrate()

But after implementing I noticed whenever I receive Push notification and after tapping on notification it won’t let enter in UNUserNotificationCenter delegate function which is :

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
completionHandler()
}

Kindly help


#2

Hey @Vinayak_Pal

Can you ensure you are assigning your delegate object to the UNUserNotificationCenter object before your app finishes launching.

For example, in an iOS app, you must assign it in the application(_:willFinishLaunchingWithOptions:) or application(_:didFinishLaunchingWithOptions:) method of your app delegate.

Below code snippet will be helpful:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
   UNUserNotificationCenter.current().delegate = self
}

Thanks!


#3

I applied claver tap instant method before notification delegate method and that solved the problem.