Skip to content
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

Add ability to specify custom data in Push payloads #176

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wkal-pubnub
Copy link
Contributor

@wkal-pubnub wkal-pubnub commented Feb 26, 2025

A new optional parameter for Channel.sendText - customPushData: Map<String,String> that lets users specify custom key values that will be put into the FCM message (in data) and/or APNS (in root object) that is sent with the message and also with every user mention.

TODO: tests, JS wrapper

@@ -280,6 +280,7 @@ abstract class BaseChannel<C : Channel, M : Message>(
quotedMessage: Message?,
files: List<InputFile>?,
usersToMention: Collection<String>?,
customPushData: Map<String, String>?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question to this feature. How would you test it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the push data is merged into the message content, so I would test that the message was sent (possibly with a mock of the publish PN SDK function) with the correct data in the correct place in the FCM and APNS payloads

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 this pull request may close these issues.

2 participants