I have downloaded workmanager repository on Github. then I add some code in the callback dispatcher. I have included the code below. Then I debug using Xcode.
After pressing the Background Fetch button (in Xcode), the app went minimize & starts warkmanager by showing a local notification. but when I close my app (terminate, remove from recent), not running in the background.
when the app is minimized, the app is working fine. but not working in the background.
I have tested with the release build.
what should I do right now?
This code I added inside the callback dispatcher
for (int i = 0; i < 1000; i++) {
await Future.delayed(const Duration(seconds: 5));
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 10,
channelKey: 'basic_channel',
title: i.toString(),
body: 'Workmanager '));
print("background $i");
}
await Future.delayed(const Duration(minutes: 15));
I have initialized the notification package before this code.