Push Payload Receivers
Handling Push Notification Click Events in iOS with Netmera SDK
Implementing UNUserNotificationCenter Delegate
UNUserNotificationCenter Delegate// In didFinishLaunchingWithOptions (AppDelegate.swift)
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
} else {
// Fallback on earlier versions
}// In didFinishLaunchingWithOptions (AppDelegate.m)
[UNUserNotificationCenter currentNotificationCenter].delegate = self;Handle Push Notification Click Events
func userNotificationCenter(
_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void
) {
// NetmeraPushObject(dictionary: response.notification.request.content.userInfo)
// object.alert.body // Push Text
// object.alert.title // Push Title
// object.action.deeplinkURL // Push Deeplink
// object.customDictionary // Custom JSON
}- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{
// NetmeraPushObject *object = [[NetmeraPushObject alloc] initWithDictionary:response.notification.request.content.userInfo];
// object.alert.body // Push Text
// object.alert.title // Push Title
// object.action.deeplinkURL // Push Deeplink
// object.customDictionary // Custom JSON
}Push Notification Received
Push Notification Received on Foreground
Retrieve Device Push Token
Last updated
Was this helpful?