Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Android device only receive 1 notification when offline.

Open
#812 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, java

Research direction

Start with the AndroidConfig.builder().setCollapseKey usage and the Firebase Admin Java SDK 9.1.1 configuration described in the issue. Reproduce with an Android device in airplane mode, sending three notifications with distinct collapse keys through the FCM HTTP v1 endpoint, then compare the result with the APNs configuration. Done means determining whether the Android delivery behavior is expected or identifying a documented SDK or FCM issue.

Written by the indexing model from the issue text.

Description

My app sends non-collapsible push notification.
When push notification are sent while device is online, everything works fine. Notifications are sent one by one. The problem is that if the device is offline (closed or airplane mode) only the last notification sent is received when the device come back online.

A work around that seems to be popular online is to generate unique collapseKey to force firebase to push notification in separate "collapse group".
I know the limit is only 4 collapse key, but it is enough notifications for the app I'm building.

I've achieved the desired result on IOS by settings my apns-collapse-id to a random UUID for each notifications but now that I'me trying with android it doesn't seems to work.

I uses
Firebase-admin version 9.1.1

<dependency>
      <groupId>com.google.firebase</groupId>
      <artifactId>firebase-admin</artifactId>
      <version>9.1.1</version>
</dependency>

This library uses FCM HTTP v1 endpoint

The collapseKey fields works.
When setting it with this function : AndroidConfig.builder().setCollapseKey("non_unique_collapse_key").build()

The notifications are overwritten.

If I set it like this : AndroidConfig.builder().setCollapseKey(UUID.randomUUID().toString()).build()

All notification are sent separately.

The problem is that if I put my android to airplane mode, send myself 3 notifications (with 3 different collapse_key)
When I put my device back online, I only receive the last notification sent.

The same cannot be said for IOS.

I set my notification like so :

ApnsConfig.builder().putHeader("apns-collapse-id", collapseKey)
        .setAps(Aps.builder().setAlert(
            ApsAlert.builder().setTitle(title).setBody(notificationContent).build()).build())
        .build();

and when I put my iphone back online, I receive 3 notifications.

Dominant language
Java
Stars
620
Forks
305
Avg merge
3h 23m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/firebase-admin-java

All issues in firebase/firebase-admin-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.