-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Hello, wonderful package! in general is working perfectly but I'm having trouble with foreground notification not displaying either the notification title nor the notification text. I'm new to flutter so I wanted to check if I might be implementing the config wrong or is there another possible issue. the function the I'm using to manage the enabling of the background task is as follows:
`
void _startBackgroundTask() async {
const androidConfig = FlutterBackgroundAndroidConfig(
notificationTitle: "flutter_background example app",
notificationText: "Background notification for keeping the example app running in the background",
notificationImportance: AndroidNotificationImportance.normal,
showBadge: true,
enableWifiLock: true,
notificationIcon: AndroidResource(name: 'background_icon', defType: 'drawable'),
);
bool hasPermissions = await FlutterBackground.initialize(androidConfig: androidConfig);
if (hasPermissions) {
success = await FlutterBackground.enableBackgroundExecution();
}
if (success) {
setState(() {
_isRunning = true;
});
_timer = Timer.periodic(const Duration(seconds: 5), (timer) {
log("Background task running: ${DateTime.now()}");
});
}
}
`
Simple timer with a log just to check if the background task is executing, so far so good, only problem is that the notification shown is:
In English the message shown says "Moonshot is executing" in the title and "Tap to get more information or stop the app" in the text. When tapped the notification opens the configuration options of the app. Don't know if I'm missing something on the implementation or is it something on my OS. Any help is much appreciated!
