Track Push & In-App Notifications

Prev Next

Once you have installed the Mapp Engage SDK and configured your AppConfig.plist, you can track push and in‑app notification interactions by implementing the Engage SDK delegate methods in your AppDelegate.

Push and in‑app delivery is handled by the Mapp Engage SDK. The Mapp Intelligence SDK only attributes the resulting events to the same user / session when the two SDKs are used together with User Matching.

Track received and opened push notifications

Adopt AppoxeeDelegate and AppoxeeNotificationDelegate on your AppDelegate and implement the handler:

class AppDelegate: UIResponder, UIApplicationDelegate,
                   AppoxeeDelegate, AppoxeeNotificationDelegate {

    func appoxee(_ appoxee: Appoxee,
                 handledRemoteNotification pushNotification: APXPushNotification,
                 andIdentifer actionIdentifier: String) {
        // Forward to your analytics / routing layer if needed.
    }
}
#import "AppoxeeSDK.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate, AppoxeeDelegate, AppoxeeNotificationDelegate>
@end

@implementation AppDelegate

- (void)appoxee:(Appoxee *)appoxee
    handledRemoteNotification:(APXPushNotification *)pushNotification
                 andIdentifer:(NSString *)actionIdentifier {
    // Forward to your analytics / routing layer if needed.
}

@end

Track in‑app messages

For in‑app message tracking, additionally adopt AppoxeeInappDelegate and implement the in‑app callbacks:

class AppDelegate: UIResponder, UIApplicationDelegate,
                   AppoxeeDelegate,
                   AppoxeeNotificationDelegate,
                   AppoxeeInappDelegate {

    func appoxeeInapp(_ appoxeeInapp: AppoxeeInapp,
                      didReceiveInappMessageWithIdentifier identifier: NSNumber,
                      andMessageExtraData messageExtraData: [String: Any]?) { }

    func inAppCallFailed(withResponse response: String?, andError error: Error?) { }

    func didReceiveDeepLink(withIdentifier identifier: NSNumber,
                            withMessageString message: String,
                            andTriggerEvent triggerEvent: String) { }

    func didReceive(inBoxMessages messages: [Any]?) { }

    func didReceive(_ message: APXInBoxMessage?) { }
}
#import "AppoxeeInappSDK.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate,
                                       AppoxeeDelegate,
                                       AppoxeeInappDelegate,
                                       AppoxeeNotificationDelegate>
@end

@implementation AppDelegate

- (void)appoxeeInapp:(AppoxeeInapp *)appoxeeInapp
    didReceiveInappMessageWithIdentifier:(NSNumber *)identifier
                     andMessageExtraData:(NSDictionary<NSString *, id> *)messageExtraData { }

- (void)inAppCallFailedWithResponse:(NSString *)response andError:(NSError *)error { }

- (void)didReceiveDeepLinkWithIdentifier:(NSNumber *)identifier
                       withMessageString:(NSString *)message
                         andTriggerEvent:(NSString *)triggerEvent { }

- (void)didReceiveInBoxMessages:(NSArray *)messages { }

- (void)didReceiveInBoxMessage:(APXInBoxMessage *)message { }

@end

Tie events back to Mapp Intelligence

To attribute push / in‑app interactions to a known Intelligence user, enable User Matching so the Engage dmcUserID is shared with Mapp Intelligence.

If you also want a Mapp Intelligence event for a specific message interaction, send an action event from inside the relevant Engage delegate callback:

let action = MIActionEvent(name: "InAppMessageOpened")
action.eventParameters = MIEventParameters(dictionary: [
    1: "messageId-\(identifier)"
])
MappIntelligence.shared()?.trackAction(action)

Related: Set Up Mapp Engage for Push & In-App Notifications, User Matching, Events.