Lyokone / flutterlocation

A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.
MIT License
1.11k stars 820 forks source link

How to disable notifications while running in the background #928

Open whgkstmf opened 8 months ago

whgkstmf commented 8 months ago

Location service notifications turn on when running location service in the background, is there a way to turn it off?

Of course, I know there is a changeNotificationOptions function in the location library that modifies notifications when running in the background, but I can't turn off notifications with that, so I'm asking if the library currently provides the ability to turn off notifications.

If not, should I touch the location library source myself?

Koboo commented 8 months ago

AFAIK there is currently no way to disable the notification.

e.g. here is the android method call handler.

https://github.com/Lyokone/flutterlocation/blob/master/packages/location/android/src/main/java/com/lyokone/location/MethodCallHandlerImpl.java#L192

So right now you can't disable the notification