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
| Platform | Behavior |
|---|---|
| Android | Processes the notification data without displaying a system notification. Triggers push open tracking and deeplink actions. |
| iOS | Behaves 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);
}| Parameter | Type | Description |
|---|---|---|
| notificationData | Map<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
| 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 |
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.