onDidReceiveNotificationResponse function

void onDidReceiveNotificationResponse(
  1. NotificationResponse response
)

Implementation

@pragma('vm:entry-point')
void onDidReceiveNotificationResponse(NotificationResponse response) {
  String? payload = response.payload;

  debug(
      'FlutterLocalNotificationController - onDidReceiveNotificationResponse, payload: $payload');

  if (payload != null) {
    UserTask? task = AppTaskController().getUserTask(payload);
    info('User Task notification selected - $task');
    if (task != null) {
      task.onNotification();
    } else {
      warning('Error in callback from notification - no task found.');
    }
  } else {
    warning("Error in callback from notification - payload is '$payload'");
  }
}