handleForegroundMessage function

Future<void> handleForegroundMessage(
  1. BuildContext context,
  2. RemoteMessage message
)

Handles background notification messages.

If the dealer app should process the message, it displays the message using showInAppNotification.

Implementation

Future<void> handleForegroundMessage(
  BuildContext context,
  RemoteMessage message,
) async {
  final container = ProviderScope.containerOf(context, listen: false);

  await _processFcmMessage(
    'foreground',
    container: container,
    message: message,
    onNotifyDevice: (notification) =>
        showInAppNotification(context, toInAppNotification(notification)),
  );
}