8000 FR: Surface notification_count to AndroidNotification builder · Issue #308 · firebase/firebase-admin-java · GitHub
[go: up one dir, main page]

Skip to content

FR: Surface notification_count to AndroidNotification builder #308

@knocknarea

Description

@knocknarea

Step 2: Describe your environment

  • Operating System version: Server (Mac/Linux)
  • Firebase SDK version: 6.10.0
  • Library version: N/A
  • Firebase Product: cloud messaging (auth, database, storage, etc)

[REQUIRED] Step 3: Describe the problem

Unable to set the android badge count via the Builder methods for AndroidNotification.

The json spec suggests this is the location to set such data, however, this is not surfaced to the builder yet.

Steps to reproduce:

I am trying to issue a Push Notification through FirebaseAdmin from my server and I can set the badge count on APNS using

builder.setApnsConfig(
  ApnsConfig.builder().setAps(
  Aps.builder().setBadge(badgeCount).build()).build());

Relevant Code:

However, there is no equivalent method on the AndroidNotification class to set the notification_count (even though it is specified in the json spec)

https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidnotification

Ideally... ?

builder.setAndroidConfig(
 AndroidConfig.builder().setNotification(
 AndroidNotification.builder().setNotificationCount(badgeCount).build())
 .build());

Maybe there's another way to do this, but I prefer to use the Admin SDK. Apologies if I am barking up the wrong tree.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0