enablePushEngagementTracking method
Future<void>
enablePushEngagementTracking({
- dynamic onNotificationTapped(
- NotificationResponse
Enable push notification engagement tracking
onNotificationTapped optional callback that will be invoked when user taps a notification.
The callback receives the notification data payload as a Map<String, dynamic>.
Navigation Behavior:
- If
onNotificationTappedis provided: SDK skips automatic navigation, you handle it in the callback - If
onNotificationTappedis null: SDK handles navigation automatically based on payload
Engagement tracking always happens regardless of callback presence.
Implementation
Future<void> enablePushEngagementTracking({
Function(NotificationResponse)? onNotificationTapped,
}) async {
await EngagementTrackingService.instance.initialize(
onNotificationTapped: onNotificationTapped,
);
}