transistorsoft / flutter_background_geolocation

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

Notify dismiss immediately after enter in geofence. #1274

Closed PierreBizzottoSTEB closed 2 months ago

PierreBizzottoSTEB commented 4 months ago

Your Environment

bg.BackgroundGeolocation.ready(bg.Config( reset: true, debug: false,

  //logLevel: Config.LOG_LEVEL_VERBOSE,
  desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
  distanceFilter: 10.0,

  backgroundPermissionRationale: bg.PermissionRationale(
      title:
          "Allow {applicationName} to access this device's location even when the app is closed or not in use.",
      message:
          'This app collects location data to enable recording your trips to work and calculate distance-travelled.',
      positiveAction: 'Change to "{backgroundPermissionOptionLabel}"',
      negativeAction: 'Cancel'),
  stopOnTerminate: false,
  startOnBoot: true,
  enableHeadless: true,
  //heartbeatInterval: 10,
)).then((bg.State state) {
  bg.BackgroundGeolocation.start();
});

## Expected Behavior
<!--- Tell us what should happen -->
Present Notification when enter in geofence and don't remove it
## Actual Behavior
<!--- Tell us what happens instead -->
Dismiss immediately Notification when enter in geofence.

## Steps to Reproduce
<!--- reproduce this issue; include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- What were you trying to do? -->

## Debug logs
<!-- include iOS / Android logs
- ios XCode logs,
- use #getLog #emailLog methods (@see docs)
- Android: $ adb logcat -s TSLocationManager
-->
<details>
    <summary>Logs</summary>

``` <!-- syntax-highligting:  DO NOT REMOVE -->
PASTE_YOUR_LOGS_HERE

christocracy commented 4 months ago

What notification are you talking about?

PierreBizzottoSTEB commented 4 months ago

When my device enter in a geofence I send a firebase notification a show them with awesome_notificatios. The notification arrive correctly, showed but immediately closed. I'm try on android and I use Lockito to simulate movement.

christocracy commented 4 months ago

send a firebase notification

I don’t see how the plug-in could be involved with that.

PierreBizzottoSTEB commented 4 months ago

Hi Chris,

thanks for your replay.

But I don’t understand if I stop the simulator of movement and I try to send firebase notify with a button it’s ok. But if I send notify onGeofence event the notify dismiss immediately.

Have you some cases where you send notify ongeofence?

Thanks

Pierre

Da: Chris Scott @.> Inviato: giovedì 11 aprile 2024 09:52 A: transistorsoft/flutter_background_geolocation @.> Cc: PierreBizzottoSTEB @.>; Author @.> Oggetto: Re: [transistorsoft/flutter_background_geolocation] Notify dismiss immediately after enter in geofence. (Issue #1274)

send a firebase notification

I don’t see how the plug-in could be involved with that.

— Reply to this email directly, view it on GitHub https://github.com/transistorsoft/flutter_background_geolocation/issues/1274#issuecomment-2049130474 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7XRMINU5KC2SCOJHXWMJLY4Y6JDAVCNFSM6AAAAABGBFMFYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGEZTANBXGQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AU7XRMLCXYC6LKQKA4DMKF3Y4Y6JDA5CNFSM6AAAAABGBFMFYOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT2EM76U.gif Message ID: @. @.> >

christocracy commented 4 months ago

It sounds like you’re not creating your own NotificationChannel for your notifications, and re-using the plug-in’s channel.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 30 days with no activity.

PierreBizzottoSTEB commented 3 months ago

Good morning Chris,

sorry to bother you, everything seems to be implemented correctly.

But with the application closed it seems that every access to the geofence the task is queued in the background, but is then executed only when the app is reopened with the consequent sending of notifications, which I would like to be sent at the same time as accessing the geofence. What’s wrong?

Thanks in advance.

Pierre

Da: Chris Scott @.> Inviato: giovedì 11 aprile 2024 14:24 A: transistorsoft/flutter_background_geolocation @.> Cc: PierreBizzottoSTEB @.>; Author @.> Oggetto: Re: [transistorsoft/flutter_background_geolocation] Notify dismiss immediately after enter in geofence. (Issue #1274)

It sounds like you’re not creating your own NotificationChannel for your notifications, and re-using the plug-in’s channel.

— Reply to this email directly, view it on GitHub https://github.com/transistorsoft/flutter_background_geolocation/issues/1274#issuecomment-2049579577 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7XRMIZ4UN7YVCUZSMAX33Y4Z6HRAVCNFSM6AAAAABGBFMFYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGU3TSNJXG4 . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AU7XRMMN47S2I6CI3GVP7HDY4Z6HRA5CNFSM6AAAAABGBFMFYOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT2FINDS.gif Message ID: @. @.> >

christocracy commented 3 months ago

But with the application closed

If by “closed” you mean “terminated”, see api docs Config.enableHeadless

PierreBizzottoSTEB commented 3 months ago

Hi Chris,

Yes, for me closed (Italian: chiusa) mean terminated.

Ok, so I need to implement notification inside headlessTask?

For case bg.Event.GEOFENCE?

Thanks

Da: Chris Scott @.> Inviato: mercoledì 15 maggio 2024 17:53 A: transistorsoft/flutter_background_geolocation @.> Cc: PierreBizzottoSTEB @.>; Author @.> Oggetto: Re: [transistorsoft/flutter_background_geolocation] Notify dismiss immediately after enter in geofence. (Issue #1274)

But with the application closed

If by “closed” you mean “terminated”, see api docs Config.enableHeadless

— Reply to this email directly, view it on GitHub https://github.com/transistorsoft/flutter_background_geolocation/issues/1274#issuecomment-2112912666 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7XRML5ZURZG5OQKNKJU4LZCOAFLAVCNFSM6AAAAABGBFMFYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSHEYTENRWGY . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AU7XRMNXEBFOOM3QQZG7Z63ZCOAFLA5CNFSM6AAAAABGBFMFYOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT56B6RU.gif Message ID: @. @.> >

PierreBizzottoSTEB commented 3 months ago

Sorry Chris,

but enableHeadless is only for Android?

For Ios?

Da: Chris Scott @.> Inviato: mercoledì 15 maggio 2024 17:53 A: transistorsoft/flutter_background_geolocation @.> Cc: PierreBizzottoSTEB @.>; Author @.> Oggetto: Re: [transistorsoft/flutter_background_geolocation] Notify dismiss immediately after enter in geofence. (Issue #1274)

But with the application closed

If by “closed” you mean “terminated”, see api docs Config.enableHeadless

— Reply to this email directly, view it on GitHub https://github.com/transistorsoft/flutter_background_geolocation/issues/1274#issuecomment-2112912666 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7XRML5ZURZG5OQKNKJU4LZCOAFLAVCNFSM6AAAAABGBFMFYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJSHEYTENRWGY . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AU7XRMNXEBFOOM3QQZG7Z63ZCOAFLA5CNFSM6AAAAABGBFMFYOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT56B6RU.gif Message ID: @. @.> >

christocracy commented 3 months ago

Yes, as documented, it’s Android only.

just like your reported issue.

Platform: Android OS version:13 Device manufacturer / model: Redmi note 11S

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.