showNotification method

  1. @override
Future<void> showNotification({
  1. required String title,
  2. required String body,
  3. String? icon,
  4. String id = 'mcp_notification',
})
override

Show notification

Implementation

@override
Future<void> showNotification({
  required String title,
  required String body,
  String? icon,
  String id = 'mcp_notification',
}) async {
  try {
    await methodChannel.invokeMethod<void>('showNotification', {
      'title': title,
      'body': body,
      'icon': icon,
      'id': id,
    });
  } on PlatformException catch (e) {
    throw MCPPlatformException(
        'Failed to show notification', e.code, e.details);
  }
}