Feature Description
I'd like to be able to customize/add actions to the foreground service notification shown to Android users (and potentially whatever the iOS equivalent is, if any).
Use Case
In my case, at various times there's different actions the user can take when the background service is running: they can pause/resume the monitoring that's happening in the background, stop the monitoring all-together, or they can react to certain locations. I'd like to show those as actions in the notification itself.
Google Maps navigation, for example, shows a "Exit Navigation" action button in it's ongoing notification.
This may have been considered previously (to some extent) because there's a stopActionTitle property that can be passed to the foregroundService configuration, but as far as I can tell, it isn't actually used anywhere in the code. So I'm guessing at some point there was meant to be a "Stop" action button added to the notification?
Proposed Solution
Allow passing an array of actions that can be included in the notification.
Alternatives Considered
My current options are:
- Showing a second notification for specific events.
- Using a custom notification within the app - so when the user clicks the notification my app shows a notification popup (or bottom sheet, etc).
I've tried modifying the notification with expo-notifications by passing the same ID, but that doesn't seem to have any effect.
Additional Context
Notification actions
Feature Description
I'd like to be able to customize/add actions to the foreground service notification shown to Android users (and potentially whatever the iOS equivalent is, if any).
Use Case
In my case, at various times there's different actions the user can take when the background service is running: they can pause/resume the monitoring that's happening in the background, stop the monitoring all-together, or they can react to certain locations. I'd like to show those as actions in the notification itself.
Google Maps navigation, for example, shows a "Exit Navigation" action button in it's ongoing notification.
This may have been considered previously (to some extent) because there's a
stopActionTitleproperty that can be passed to theforegroundServiceconfiguration, but as far as I can tell, it isn't actually used anywhere in the code. So I'm guessing at some point there was meant to be a "Stop" action button added to the notification?Proposed Solution
Allow passing an array of actions that can be included in the notification.
Alternatives Considered
My current options are:
I've tried modifying the notification with
expo-notificationsby passing the same ID, but that doesn't seem to have any effect.Additional Context
Notification actions