RocketChat / RocketChat/Rocket.Chat

Add App Identifier to Push Notification Payload

Open
#35,685 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

We have built a custom push gateway to support push notifications for both the official Rocket.Chat app and our white-labeled app. To improve app-specific handling, it would be useful to include the app identifier in the notification payload, allowing the gateway to distinguish which app the notification is intended for.

Currently, the app identifier is already included in the payload send to the APN endpoint because there it is used as topic, but it is left out for the GCM endpoint:
https://github.com/RocketChat/Rocket.Chat/blob/c5f67341a5604dfbbba45c653d52a14590050292/apps/meteor/app/push/server/push.ts#L340-L348

Since the field topic is likely intended for notification topics, we propose adding a separate field appName (or similar) to the payload in addition to the topic field.

This allows a push gateway to decide how (or if) to handle a push notification.

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.

Research direction

Start in apps/meteor/app/push/server/push.ts around lines 340-348 and compare the APN and GCM payload construction. Confirm how the app identifier is currently used for the APN topic, then add the proposed separate identifier field to the GCM payload; done means a push gateway can distinguish the official and white-labeled apps without changing the topic field.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.