transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
643 stars 237 forks source link

Help - Many notification location service enabled #272

Closed niypoo closed 4 years ago

niypoo commented 4 years ago

I'm using only GeoFence and I have noticed The Location Service is Enabled notification show up many time in short period time 45 in 3 hours so I want to know what is wrong in my code or Hoe can decrement that.

OS : Android 10

 //start geoFence
      bg.BackgroundGeolocation.ready(
        Config(
          disableLocationAuthorizationAlert: true,
          enableHeadless: true,
          disableMotionActivityUpdates: true,
          stopOnTerminate: false,
          startOnBoot: true,
          geofenceInitialTriggerEntry: false,
          geofenceModeHighAccuracy:
              false, // <-- consumes more power; default is false.
        ),
      ).then(
        (state) {
          if (!state.enabled) {
            // engage geofences-only mode:
            BackgroundGeolocation.startGeofences();
          }
        },
      );

97948518_237537230645556_3956751652370776064_n

christocracy commented 4 years ago

The plugin must still periodically request a location to determine geofences in proximity.

A foreground-service is initiated for a brief instant when ever a location is requested, when your app boots and when a geofence event occurs.

niypoo commented 4 years ago

The plugin must still periodically request a location to determine geofences in proximity.

A foreground-service is initiated for a brief instant when ever a location is requested, when your app boots and when a geofence event occurs.

so there is any way to decrement these attempts. 45 in 3 hours it's to many an announcing

christocracy commented 4 years ago

If that's your development device, the number is going to be inflated because of booting your app all the time.

christocracy commented 4 years ago

My Pixel 3a @ 10 displays ~31 per day with location+geofencing mode and I'm regularly out field-testing with this device.

niypoo commented 4 years ago

no not mine, it's device of one of tester , that noticed that and he disabled that and send informed me about that , so I don't want annoy users for make them disabled this feature

christocracy commented 4 years ago

Regardless of geofence-only mode, the plugin does launch a foreground-service periodically for a brief instant.

christocracy commented 4 years ago

You can modify the title and text of the notification via Config.notification

niypoo commented 4 years ago

You can modify the title and text of the notification via Config.notification

I have used useSignificantChangesOnly options and set it to true and I noticing decrement that notifications shows in notification bar ! is this way right ?

christocracy commented 4 years ago

useSignificantChangesOnly isn’t used with startGeofences.

niypoo commented 4 years ago

useSignificantChangesOnly isn’t used with startGeofences. I have to test it again :(

christocracy commented 4 years ago

I've given the geofencing-only system a refactoring. If your Android app is monitoring less than 100 geofences, the SDK will no longer initiate its infinite geofencing system to periodically query geofences-in-proximity. A foreground-service will only invoke when a geofence event occurs. Will be available in next merge to master. iOS already behaves like this (though iOS' geofence maximum is only 20).

niypoo commented 4 years ago

I've given the geofencing-only system a refactoring. If your Android app is monitoring less than 100 geofences, the SDK will no longer initiate its infinite geofencing system to periodically query geofences-in-proximity. A foreground-service will only invoke when a geofence event occurs. Will be available in next merge to master. iOS already behaves like this (though iOS' geofence maximum is only 20).

sounds great , thank you for remember that task . I'm waiting this release . and please let me know if there any changes I should do to active this new feature.


Config(
          disableLocationAuthorizationAlert: true,
          enableHeadless: true,
          disableMotionActivityUpdates: true,
          stopOnTerminate: false,
          startOnBoot: true,
          geofenceInitialTriggerEntry: false,
          geofenceModeHighAccuracy:
              false, // <-- consumes more power; default is false.
        ),
christocracy commented 4 years ago

There’s nothing special to do. It’s all automatic.

niypoo commented 4 years ago

There’s nothing special to do. It’s all automatic.

Awesome

christocracy commented 4 years ago

Try installing latest 1.9.1. If you're upgrading from before 1.9.0, see the CHANGELOG.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.