Comments (7)
A foreground service is required to track background location on the Android platform. The notification serves to notify the user that the foreground service has started.
So, if you want to remove the notification, you don't need to use the WillStartForegroundTask
widget. However, it may not be able to track your location in the background.
from geofence_service.
Alright, understand. And what about those two notifications? The upper one is created with an other plugin. The one below is the one from WillStartForegroundTask() (see code below). Is this lower one even visible when the user got the app on a real device (because that's how I want it)?
home: WillStartForegroundTask(
onWillStart: () async {
// You can add a foreground task start condition.
return _geofenceService.isRunningService;
},
androidNotificationOptions: const AndroidNotificationOptions(
channelId: 'geofence_service_notification_channel',
channelName: 'Geofence Service Notification',
channelDescription:
'This notification appears when the geofence service is running in the background.',
channelImportance: NotificationChannelImportance.NONE,
priority: NotificationPriority.MIN,
isSticky: false,
visibility: NotificationVisibility.VISIBILITY_SECRET,
showWhen: false,
),
iosNotificationOptions:
const IOSNotificationOptions(showNotification: false),
notificationTitle: 'xxx',
notificationText: 'yyy',
child: Scaffold(.........
from geofence_service.
A notification must be created to start a foreground service. A foreground service is also called a service that is visible to the user. So, just because a channel is of low importance cannot hide a notification.
from geofence_service.
I don't speak English well, so I didn't understand what the question was. It would be helpful to answer if you could explain a little more.
from geofence_service.
Yes, no problem, thank you for taking your time :-)
I don’t want the user to get notifications when the foreground task (method willStartForegroundTask)
() ) is called. Therefore, i set (for iOS) iosNotificationOptions:
const IOSNotificationOptions(showNotification: false) and now the notification of this method isn’t shown on iOS
For Android, i want to do the same but there isn’t a similar boolean like „showNotification“ and i can’t set androidNotificationOptions: null because then the app crashes. That’s why i set IMPORTANCE_NONE, but the notification is still there (see the picture, it it the lower notification with grey icon), and somehow you can’t delete this notification on the simulator.
So two questions:
- Is it possible to not show the Android notification (like the iOS notification with the boolean showNotification)?
- Will the notification on a real device be shown, when it’s set IMPORTANCE_NONE?
from geofence_service.
-
No. The notification could not be removed. To start the foreground service according to the Android platform's policy, must create a notification.
-
For the same reason as above, the notification appears even if the notification importance is set to 'NONE' or 'LOW'. Also, users cannot remove notifications.
from geofence_service.
Aight thank u! :)
from geofence_service.
Related Issues (20)
- Does not work when App is killed (iOS 15.0) HOT 1
- Geofence_service breaks local notifications on iOS HOT 4
- WillStartForegroundTask blocks WillPopScope HOT 1
- Updating the data on iOS HOT 1
- Not working when app is removed HOT 4
- Unable to kill app from Paused state in Android HOT 2
- Notification when DWELL HOT 2
- Multiple _geofenceServices HOT 1
- send text between devices HOT 4
- unable to get any notification HOT 1
- java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.SettingsClient, HOT 3
- Issue with shared_preferences package HOT 2
- fl_location version needs to be updated
- not working in the background
- Geofence is not working on background state HOT 1
- I want to run Geofence_Service in the background HOT 2
- How can I trigger a notfication for the app to open a view
- GeoFence runs in Background
- onGeofenceStatusChanged does not work in release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geofence_service.