isDuplicateNotification method

  1. @override
Future<bool> isDuplicateNotification(
  1. String duplicateKey,
  2. Duration? timeWindow
)
override

Check if a notification with the same duplicate key exists

Implementation

@override
Future<bool> isDuplicateNotification(String duplicateKey, Duration? timeWindow) async {
  try {
    final result = await methodChannel.invokeMethod<bool>('isDuplicateNotification', {
      'duplicateKey': duplicateKey,
      'timeWindow': timeWindow?.inSeconds,
    });
    return result ?? false;
  } on PlatformException catch (e) {
    debugPrint('Error checking duplicate notification: ${e.message}');
    return false;
  }
}