onDidReceiveNotificationResponse function

void onDidReceiveNotificationResponse(
  1. NotificationResponse response
)

Callback method called when a notification is clicked in the operating system.

Implementation

@pragma('vm:entry-point')
void onDidReceiveNotificationResponse(NotificationResponse response) {
  String? payload = response.payload;
  debug('NotificationManager - callback on notification, payload: $payload');

  if (payload == null) {
    warning(
      "NotificationManager - Error in callback from notification - payload is '$payload'",
    );
  } else if (AppTaskController().getUserTask(payload) != null) {
    AppTaskController().onNotification(payload);
  } else {
    FlutterLocalNotificationManager()._taps.add(payload);
  }
}