Foreground Push Open Tracking

Prev Next

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 in the foreground, the triggerPushProcessWithNotificationData method allows you to trigger push open tracking and deeplink handling without displaying a system notification.

Platform behavior

PlatformBehavior
AndroidProcesses the notification data without displaying a system notification. Triggers push open tracking and deeplink actions.
iOSBehaves identically as handleNotification. Logs push open and triggers interactive actions.

Prerequisites

  • 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.

Usage

// When the user taps your custom in-app notification
void onInAppNotificationTapped(Map<String, String> notificationData) {
  FlutterInsider.Instance.triggerPushProcessWithNotificationData(notificationData);
}
ParameterTypeDescription
notificationDataMap<String, String>The push notification payload data from the push provider

Example for custom foreground notification handling

FirebaseMessaging.onMessage.listen((RemoteMessage message) {
  Map<String, String> data = message.data.map(
    (key, value) => MapEntry(key, value.toString()),
  );
  if (isAppInForeground) {
    // Display your own in-app notification UI
    showCustomNotification(data, onTap: () {
      // Trigger push open tracking when user taps
      FlutterInsider.Instance.triggerPushProcessWithNotificationData(data);
    });
  } else {
    // Let Insider handle normally
    FlutterInsider.Instance.handleNotification(message);
  }
});

Comparison with handleNotification

FeaturehandleNotificationtriggerPushProcessWithNotificationData
Displays system notification (Android)YesNo
Triggers push open trackingYesYes
Executes deeplink actionsYesYes
iOS behaviorStandard handlingSame as handleNotification

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