getLastRemotePushNotification method

  1. @override
Future<RemoteNotificationData?> getLastRemotePushNotification()
override

Implementation

@override
Future<RemoteNotificationData?> getLastRemotePushNotification() async {
  try {
    var notificaiton = await methodChannel.invokeMethod('getLastRemotePushNotification');

    if (notificaiton == null) { return null; }

    return RemoteNotificationData(notificaiton['id'] as String, notificaiton['title'] as String);
  }
  on PlatformException catch(exception) {
    log.severe('Exception when displaying last received notification: ${exception.message}');
    return null;
  }
}