Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Android device only receive 1 notification when offline.

Đang mở
#812 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
android, java
Lĩnh vực
backend, mobile-dev

Hướng nghiên cứu

Bắt đầu với việc sử dụng AndroidConfig.builder().setCollapseKey và cấu hình Firebase Admin Java SDK 9.1.1 được mô tả trong issue. Tái hiện với một thiết bị Android ở chế độ máy bay, gửi ba thông báo có các collapse key khác nhau thông qua endpoint FCM HTTP v1, sau đó so sánh kết quả với cấu hình APNs. Hoàn thành khi xác định được hành vi gửi đến của Android có đúng như mong đợi hay không, hoặc xác định được một vấn đề đã được ghi nhận của SDK hoặc FCM.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
620
Fork
305
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-admin-java

Tất cả issue của firebase/firebase-admin-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.