![](/img/trans.png)
[英]Issue in Displaying Notification with awesome_notifications in Flutter
[英]Flutter Awesome Notifications scheduled notification doesn't work
這是我在 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);
嘗試將 channelKey 從 basic_channel 更改為 scheduled
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.