addForegroundNotificationListener method

Future<void> addForegroundNotificationListener(
  1. ValueSetter<ApphudNotificationPayload> callback
)

Registers a callback function for foreground notifications processed by Apphud The callback will have ApphudNotificationPayload data.

Make sure to add SwiftApphudPlusPlugin.handleForegroundNotifications to AppDelegate.swift (check README)

Implementation

Future<void> addForegroundNotificationListener(
    ValueSetter<ApphudNotificationPayload> callback) async {
  return ApphudPlusPlatform.instance
      .addForegroundNotificationListenerRaw(callback);
}