isAlreadyReceivedPushNotification static method

Future<bool> isAlreadyReceivedPushNotification(
  1. Map<String, dynamic> data
)

Detect the message has already been received or not. The device may receive duplicated messages if the application is being uninstalled and re-installed repeatedly.

Implementation

static Future<bool> isAlreadyReceivedPushNotification(Map<String, dynamic> data) async {
  if (Platform.isAndroid) {
    final isReceived = await _channel.invokeMethod<bool>('isAlreadyReceivedPushNotification', data);
    return isReceived!;
  }
  return false;
}