这是notifications.dart文件中的scheduledNotification函数,当我调用这个函数时,是否必须以10秒的间隔发出通知
Future<void> scheduledNotification(int hour,int minute, int second) async {
String timezom = await AwesomeNotifications().getUtcTimeZoneIdentifier();
await AwesomeNotifications().createNotification(
content: NotificationContent(
id: uniqueId(),
channelKey: 'basic_channel',
title: "$bullAd is Dying",
body: "Eat and Feed it",
color: progressColor),
schedule: NotificationCalendar(
allowWhileIdle: true,
repeats: true,
millisecond: 0,
second: second+10,
hour: hour,
minute: minute));
}
int lastFeedHour = DateTime.now().hour;
int lastFeedMinute = DateTime.now().minute;
int lastFeedSecond = DateTime.now().second;
scheduledNotification(lastFeedHour,lastFeedMinute,lastFeedSecond);
1条答案
按热度按时间rxztt3cl1#
尝试将channelKey从basic_channel更改为预定