info |
SDK Version All the below functions are supported from SDK version 9.13.0 |
Track Notification Received
Call SDK's logNotificationReceived(withPayload: ) function to track notification received impression as shown below.
MoEngageSDKMessaging.sharedInstance.logNotificationReceived(withPayload:notification.request.content.userInfo)
[[MoEngageSDKMessaging sharedInstance] logNotificationReceivedWithPayload:notification.request.content.userInfo];
Track Notification Click
Call SDK's logNotificationClicked(withPayload: ) function to track notification clicked event as shown below.
MoEngageSDKMessaging.sharedInstance.logNotificationClicked(withPayload: notification.request.content.userInfo)
[[MoEngageSDKMessaging sharedInstance] logNotificationClickedWithPayload:notification.request.content.userInfo];
NoteTo use above functions, Appdelegate swizzling should be disabled. To see how to disable swizzling, please see the link. |
Validate if the notification belongs to MoEngage
Call SDK's isPushFromMoEngage(withPayload:) function to validate if the notification belongs to MoEngage as shown below.
let isPushFromMoEngage = MoEngageSDKMessaging.sharedInstance.isPushFromMoEngage(withPayload: notification.request.content.userInfo))
BOOL isPushFromMoEngage = [[MoEngageSDKMessaging sharedInstance] isPushFromMoEngageWithPayload:notification.request.content.userInfo];