-
Notifications
You must be signed in to change notification settings - Fork 124
Update notificationText and notificationTile text #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try updating to And using the final flutterForegroundTask = FlutterForegroundTask.instance.init(
notificationOptions: NotificationOptions(
channelId: 'notification_channel_id',
channelName: 'Foreground Notification',
channelDescription: 'This notification appears when a foreground task is running.',
channelImportance: NotificationChannelImportance.LOW,
priority: NotificationPriority.LOW
),
foregroundTaskOptions: ForegroundTaskOptions(
interval: 5000
)
);
int count = 0;
void startForegroundTask() {
flutterForegroundTask.start(
notificationTitle: 'Foreground task is running',
notificationText: 'Tap to return to the app',
taskCallback: (DateTime timestamp) {
print('timestamp: $timestamp');
count++;
flutterForegroundTask.update(
notificationTitle: 'count: $count',
notificationText: 'count: $count'
);
}
);
} The |
This solution provided does not work anymore for anyone trying to do what the original user wanted to solve. I'm using the latest version of this and this solution does not activate |
Many things have changed since version 2.0.0. check readme. |
|
To update the notification title and text when the foreground service is started, you need to use the If the notification title and text are not applied in the |
hello, great package.
Can I update the notification text, because I'm using counting timer on the notificationText
thanks.
The text was updated successfully, but these errors were encountered: