Skip to content

[Feature] Allow notification actions to be supplied with the foreground service notification #207

Description

@joekrill

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:

  1. Showing a second notification for specific events.
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions