Skip to content

Add App Identifier to Push Notification Payload #35685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NikoHadouken opened this issue Apr 2, 2025 · 0 comments · May be fixed by #35686
Open

Add App Identifier to Push Notification Payload #35685

NikoHadouken opened this issue Apr 2, 2025 · 0 comments · May be fixed by #35686

Comments

@NikoHadouken
Copy link

NikoHadouken commented Apr 2, 2025

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:

if ('apn' in app.token && app.token.apn) {
countApn.push(app._id);
return this.sendGatewayPush(gateway, 'apn', app.token.apn, { topic: app.appName, ...gatewayNotification });
}
if ('gcm' in app.token && app.token.gcm) {
countGcm.push(app._id);
return this.sendGatewayPush(gateway, 'gcm', app.token.gcm, gatewayNotification);
}

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant