Foreground Push Open Tracking

Prev Next

This method is available on Cordova since 4.1.0.

By default, the Insider SDK displays a system notification on Android when a push is received. For apps that render their own in-app notification UI while in the foreground, the triggerPushProcessWithNotificationData method triggers push open tracking and deeplink handling without displaying a system notification.

Platform behavior

Platform

Behavior

Android

Processes the notification data without displaying a system notification. Triggers push open tracking and deeplink actions.

iOS

Behaves identically to handleNotification. Logs the push open and triggers interactive actions.

Prerequisites

  • cordova-plugin-insider 4.1.0 or later.

  • The notification data must originate from Insider (contains "source": "Insider").

  • GDPR consent must be granted, and the SDK must not be in a frozen state.

Method signature

triggerPushProcessWithNotificationData(userInfo: object): void;

Parameter

Type

Description

userInfo

object

The push notification payload (key/value data) from the push provider. Must be a plain object; null, arrays, and non-object values are ignored and a parameter warning is logged.

Method example

// When the user taps your custom in-app notification
function onInAppNotificationTapped(notificationData) {
    window.Insider.triggerPushProcessWithNotificationData(notificationData);
}

Example for custom foreground notification handling

// notificationData: the data payload received from your push provider
function onPushReceived(notificationData, isAppInForeground) {
    if (isAppInForeground) {
        // Display your own in-app notification UI
        showCustomNotification(notificationData, function onTap() {
            // Trigger push open tracking when the user taps
            window.Insider.triggerPushProcessWithNotificationData(notificationData);
        });
    } else {
        // Let Insider handle the notification normally
        window.Insider.handleNotification(notificationData);
    }
}

Comparison with handleNotification

Feature

handleNotification

triggerPushProcessWithNotificationData

Displays system notification (Android)

Yes

No

Triggers push open tracking

Yes

Yes

Executes deeplink actions

Yes

Yes

iOS behavior

Standard handling

Same as handleNotification

On iOS, both methods behave identically. The distinction is only relevant on Android, where handleNotification renders a system notification while triggerPushProcessWithNotificationData does not.