showNotification method

  1. @override
Future<void> showNotification({
  1. String? title,
  2. String? body,
  3. required Map<String, dynamic> payload,
})
override

Shows a notification with the specified title, body and payload. If title is null, the title will default to 'Message from {sender_name}'. If body is null, the body will default to the message.

Implementation

@override
Future<void> showNotification({
  String? title,
  String? body,
  required Map<String, dynamic> payload,
}) async {
  await methodChannel.invokeMethod<void>(
    'showNotification',
    {
      if (title != null) 'title': title,
      if (body != null) 'body': body,
      'payload': payload,
    },
  );
}