I am using the location plugin and it is working pretty good. My only problem is the foreground notification.
On Android, a foreground notification is displayed with information that location service is running in the background.
But one can dismiss the notification on purpose or inadvertently. So my question is, is it possible to make the notification persistent at least when the app is in background or remove it all together?
My goal is to remove it all together and display my one notification which is ongoing when the app is in background.
class LocationService {
Location get location => Location.instance;
void init() async {
await Future.wait([
location.enableBackgroundMode(enable: true),
location.changeNotificationOptions(
channelName: notificationChannel.name,
iconName: 'androidIcon',
title: 'Location service running in background',
),
location.changeSettings(
interval: LocationSettings.interval,
distanceFilter: LocationSettings.distanceFilter,
),
]);
}
}