onNotificationReceived method

  1. @override
FutureOr<NotificationReceivedResponse?>? onNotificationReceived(
  1. NotificationReceivedRequest request
)
inherited

Event fired when a web notification is received.

The request contains the NotificationReceivedRequest.senderOrigin (the origin of the web content that sends the notification) and the NotificationReceivedRequest.notificationController which provides methods to report the notification status (shown, clicked, closed) back to the web content, as well as listen for the close event when the notification is closed by web code.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • request: all platforms

Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.

Implementation

@override
FutureOr<NotificationReceivedResponse?>? onNotificationReceived(
  NotificationReceivedRequest request,
) {
  return null;
}