showNotification method
Show Local Notification in Device
Implementation
Future<void> showNotification(String decryptedMessage, String atSign) async {
Notify notify = Notify.fromJson((decryptedMessage));
print('showNotification => ${notify.message} ${notify.atSign}');
var androidChannelSpecifics = const AndroidNotificationDetails(
'notify_id',
'notify',
channelDescription: "notify_description",
importance: Importance.high,
priority: Priority.high,
playSound: true,
timeoutAfter: 50000,
styleInformation: DefaultStyleInformation(true, true),
);
var iosChannelSpecifics = const DarwinNotificationDetails();
var platformChannelSpecifics = NotificationDetails(android: androidChannelSpecifics, iOS: iosChannelSpecifics);
await _notificationsPlugin.show(
0,
atSign,
'${notify.message}',
platformChannelSpecifics,
payload: notify.message,
);
}