flutterdartawesome-notifications

Flutter Awesome Notifications scheduled notification doesn't work


This is my scheduledNotification function in notifications.dart file When I call this function isn't this have to make a notification with 10 seconds gap

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);

Solution

  • try change channelKey from basic_channel to scheduled