I have already use flutter_local_notification plugin but some time it not work. i have also implement the all type notification like scheduled,show daily at a time,weekly but it can not proper work. - first can app is running on background is necessary when set a local notification? suggest me any other way for doing this. - second one question is should necessary to give a unique id to notification
my code is like below:
Future setEverydayNotification(
FlutterLocalNotificationsPlugin notifications, {
@required String title,
@required String body,
@required Time time,
int itemid,
int id = 0,
}) {
return _showEverydayNotification(notifications,
title: title, body: body, time:time, id: id,type: _onNotification );
}
Future _showEverydayNotification(
FlutterLocalNotificationsPlugin notifications, {
@required String title,
@required String body,
@required Time time,
@required NotificationDetails type,
int id = 0,
}) =>
notifications.showDailyAtTime(id, title, body, time, type,);
NotificationDetails get _onNotification {
final androidChannelSpecifics = AndroidNotificationDetails(
'3',
'name3',
'description3',
importance: Importance.Max,
priority: Priority.Max,
enableVibration: vibration,
);
final iOSChannelSpecifics = IOSNotificationDetails();
return NotificationDetails(androidChannelSpecifics, iOSChannelSpecifics);
}