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

Include user objectid in push payload #3844

Closed
SebC99 opened this issue May 22, 2017 · 3 comments
Closed

Include user objectid in push payload #3844

SebC99 opened this issue May 22, 2017 · 3 comments

Comments

@SebC99
Copy link
Contributor

SebC99 commented May 22, 2017

Issue Description

When we use a Query with multiple results to send a push notification to multiple installations/users it would be very useful to include the user objectId by default in the notification payload.
We can do it ourself for notifications which are sent one-by-one (user per user), but it's not possible to add this field when a notification is sent to multiple users with only one query.

Why would anyone need this? To check on the client side if the recipient user is the currently logged user (in case of multiple accounts on the same device)

@flovilmart
Copy link
Contributor

The installation don't hold a user by default, many developers may implement it differently, perhaps even without a user. Or keep it a a list, or even a relation. I'm not sure how the general case would work. You can probably do it in a custom push adapter, as the full installation object is passed for sending.

I can see easily that you can wrap parse-server-push-adapter into a custom module and override / call super on send:

https://github.com/parse-server-modules/parse-server-push-adapter/blob/master/src/ParsePushAdapter.js#L50

@SebC99
Copy link
Contributor Author

SebC99 commented May 22, 2017

Great idea @flovilmart! Thanks a lot for the feedback

@flovilmart
Copy link
Contributor

No problem! That should be pretty easy to override and give you the full flexibility! Which is better than modifying parse-server for each particular use case! Good luck!

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

No branches or pull requests

2 participants