onDidReceiveNotificationResponse static method

void onDidReceiveNotificationResponse({
  1. required NotificationResponse notificationResponse,
  2. dynamic onData,
})

Implementation

static void onDidReceiveNotificationResponse(
    {required NotificationResponse notificationResponse, onData}) async {
  final String? payload = notificationResponse.payload;
  if (notificationResponse.payload != null) {
    debugPrint('notification payload: $payload');
    var jsonData = jsonDecode(payload!);
    onData(jsonData);
  }
}