enablePushEngagementTracking method

Future<void> enablePushEngagementTracking({
  1. required dynamic onNotificationTapped(
    1. RelevaNotificationAction
    ),
})

Enable push notification engagement tracking.

onNotificationTapped is called when the user taps a notification. The callback receives a RelevaNotificationAction with parsed navigation fields (target, screen, url, parameters). The app must handle navigation based on these fields.

Engagement tracking always happens automatically before the callback.

Implementation

Future<void> enablePushEngagementTracking({
  required Function(RelevaNotificationAction) onNotificationTapped,
}) async {
  await EngagementTrackingService.instance.initialize(
    onNotificationTapped: onNotificationTapped,
  );
}