Basel-525k / geofence_foreground_service

Apache License 2.0
3 stars 2 forks source link

Option for persistent notification and action button #5

Closed rakesh-oasys closed 1 month ago

rakesh-oasys commented 1 month ago

I am creating a app where user location is tracking while the app is in background. The notification also coming while the app is in background but my requirment is unless the user is not clicked on dismiss/Action buttions the notification will stick to the notification bar.

Thanks, Rakesh

byshy commented 1 month ago

To make sure I understand the issue correctly, you want the persistent notification that appears on android when the app is closed to be removed? if so then unfortunately this doesn't conform the Android guidelines as every app that runs in the background should give the user an indication that it's running, the notification is not dismissible as long as the app is running.

rakesh-oasys commented 1 month ago

Hi @byshy ,

I'm sorry for phrasing my question improperly. let me ask it again.

  1. How can I add action buttons to app notifications so that users can interact with them directly from the notification bar instead of dismissing them by swiping?

  2. How can I make app notifications persistent in the notification bar, preventing users from dismissing them by swiping?

byshy commented 1 month ago

Oh okay, I got your point

The notifications that are displayed from the library are only visible when the debug mode is enabled, disabling it will prevent notifications from appearing

You can use other notification packages to help with that, you can trigger them from within the handler method, by doing so you'll achieve your goal of displaying custom notifications based on geofence triggers (keeping in mind that you diable the debug mode)