Closed archerx3 closed 6 years ago
Hey @archerx3, sure you can retrieve the userInfo from the method userNotificationCenter(_:didReceive:withCompletionHandler:).
What this will give you is all the User Info details from the userInfo object, the following code snippet will be useful for you:
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { // pull out the userInfo dictionary let userInfo = response.notification.request.content.userInfo completionHandler() }
But in Notification content extension, can call the methoduserNotificationCenter(_:didReceive:withCompletionHandler:)
?
Now, I need get the user info of notification in Notification Content Extension
.
If I am not wrong, in notification content extension
, need use the protocol UNNotificationContentExtension
to get notification, but, the base view controller CTNotificationViewController
had used it, and not provide them to us.
Hey @archerx3
Apologies for the delay in getting back here.
CleverTap provides a callback that you can implement in your Notification Content Extension subclass to get user event type data
The following code snippet will be useful:
// optional: implement to get user event type data
- (void)userDidPerformAction:(NSString *)action withProperties:(NSDictionary *)properties {
NSLog(@"user did perform action: %@ with props: %@", action , properties);
}
In method
-didReceiveNotification:(UNNotification *)notification
ofCTNotificationViewController
, we can get the user info for this notification, can open this, let we can get this user info?