Push Payload Details

Prev Next

Overview

Push Payload Details in iOS describe the data exposed by the Mapp Engage SDK when a remote notification is received or a rich-content notification is opened. Conform to AppoxeeNotificationDelegate on the Appoxee shared instance to react to push events and access the parsed payload.


Use Case

  1. Purpose:

    • Access and process push notification payloads for dynamic app behaviour.

    • Track user interaction with custom push action buttons.

  2. Benefits:

    • Drive in-app behaviour from server-side message metadata.

    • Inspect rich-content payloads when the user opens a Rich Push.


Implementation Details

Conform to AppoxeeNotificationDelegate

The delegate is set on Appoxee.shared() (typically your AppDelegate). Both selectors begin with appoxee: — there is no AppoxeeManager-prefixed selector.

class AppDelegate: UIResponder, UIApplicationDelegate, AppoxeeNotificationDelegate {

    func appoxee(_ appoxee: Appoxee,
                 handledRemoteNotification pushNotification: APXPushNotification,
                 andIdentifer actionIdentifier: String) {
        print("Push notification received: \(pushNotification) (action: \(actionIdentifier))")
    }

    func appoxee(_ appoxee: Appoxee,
                 handledRichContent richMessage: APXRichMessage,
                 didLaunchApp didLaunch: Bool) {
        print("Rich message opened (didLaunch=\(didLaunch)): \(richMessage)")
    }
}
@interface AppDelegate () <AppoxeeNotificationDelegate>
@end

@implementation AppDelegate

- (void)appoxee:(Appoxee *)appoxee
        handledRemoteNotification:(APXPushNotification *)pushNotification
        andIdentifer:(NSString *)actionIdentifier {
    NSLog(@"Push notification received: %@ (action: %@)", pushNotification, actionIdentifier);
}

- (void)appoxee:(Appoxee *)appoxee
        handledRichContent:(APXRichMessage *)richMessage
        didLaunchApp:(BOOL)didLaunch {
    NSLog(@"Rich message opened (didLaunch=%d): %@", didLaunch, richMessage);
}

@end

Warning:

The selector appoxee:handledRemoteNotification:andIdentifer: contains a typo (Identifer without the second i) in the public header. Use the selector exactly as shown.

APXPushNotification properties

The notification object passed to the delegate exposes the parsed APNs payload.

  • alert, title, subtitle, body — Standard alert fields.

  • badge — Numeric badge value.

  • uniqueID — Mapp-side identifier of the push.

  • extraFields — Dictionary of custom key/value pairs sent with the push.

  • didLaunchAppBOOL indicating whether the app was launched from a terminated state by this push.

  • isRich, isSilent, isTriggerUpdate — Flags describing the push type.

  • pushActionAPXPushNotificationAction describing the configured action(s) on the push, including the button list (APXPushNotificationActionButton) and per-button action (APXPushNotificationActionButtonAction).

Action button enum

APXPushNotificationActionButtonAction describes what each button does (for example kAPXPushNotificationActionButtonActionTodoSet, kAPXPushNotificationActionButtonActionTodoOpenURL, kAPXPushNotificationActionButtonActionTodoDialNumber). Branch on the button's action to drive in-app behaviour.

Keep in mind:

  • Test the delegate in foreground, background, and terminated states. The didLaunchApp flag distinguishes "opened from terminated" from "received while running".

  • Silent pushes (isSilent) and trigger updates (isTriggerUpdate) do not present an alert to the user. Use them to drive background work, not UI updates.

  • For the corresponding inbox/rich-content data model, see Inbox.