firebase / firebase/firebase-android-sdk

Event / callback when app is opened via a notification group

Open
#6,228 1 comment 0 reactions 0 assignees View on GitHub
api: messaging type: feature request
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 23h
Merged PRs (30d)
34

Description

## What feature would you like to see?

As described in [react-native-firebase#5716](https://github.com/invertase/react-native-firebase/issues/5716), when the user taps on a notification group, there is no corresponding event / trigger available within the app to know this occurred. It is [hinted](https://github.com/invertase/react-native-firebase/issues/5716#issuecomment-915330980) that this might be a limitation within the Firebase Android SDK itself, rather than an issue with the React Native Firebase library, hence this issue.

## How would you use it?

It looks like there is room within the API for a dedicated method when notifications are opened whilst the app is in the background:

```java
public void onMessagesReceived(@NonNull com.google.firebase.messaging.RemoteMessage[]);
```

It is less clear how this could be approached when a group of notifications are opened whilst the app is quit — I think it is not unreasonable to add a suitable `Extra` to the existing API method:

```java
public final int onStartCommand(android.content.Intent, int, int);
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the notification handling APIs around onMessagesReceived and Service.onStartCommand, along with the linked react-native-firebase#5716 discussion. Determine whether notification-group opens can expose a callback or Intent extra when the app is backgrounded or quit. Done means the supported behavior and an implementable API path are established for both app states.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, firebase, java
Domain
api, mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.