evollu / evollu/react-native-fcm

How to dismiss local notification from button click?

Open
#875 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.7k
Forks
661
PR merge metrics
No merged PRs in 30d

Description

I create a local notification with an "Accept" and "Reject" button. Clicking both brings the app to the foreground but I'd like the "Dismiss" button to remove the notification and leave the app in the background. Here is how my notification is created:

```
await FCM.presentLocalNotification({
id: id,
title: title,
body: body,
show_in_foreground: false,
click_action: "iosActions",
android_actions: JSON.stringify([{
id: "accept",
title: 'Accept'
},{
id: "reject",
title: 'Reject'
}])
});
```

How can I get it so clicking on a notification button dismisses the notification and leaves the app in the background?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing FCM.presentLocalNotification and how click_action and android_actions are handled for local notifications. Check the platform-specific notification action behavior, then verify that selecting a button dismisses the notification without bringing the app to the foreground.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, react-native
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.