Closed hypesystem closed 9 years ago
Does this plugin support topics via the to field?
We do not, currently, use the to
field at all.
Can you give me some more detail on how you would normally support topics via the to
field? I couldn't immediately find anything when I looked at the specs I linked above.
The to
field is used for multiple purposes in the new spec
Topic Messaging: https://developers.google.com/cloud-messaging/topic-messaging Group Messaging: https://developers.google.com/cloud-messaging/notifications
You can pass in a topic: /topic/foo
, a groupId (which is an alias for multiple devices), or just the deviceId
With 0.11 (not released yet) this will be possible by sending a message like so:
sender.send(message, "/topic/foo", function(error, result) {
if(error) return console.error("Error", error);
//...
});
That is exactly what this issue tracks: when it is closed, the feature will be in the master branch :)
Basically, if the second argument passed to send
is a string it will go in the to
field :)
These are great details and should probably be documented somewhere... I will look into that :)
@Deminetix version 0.11 has now been released. Let me know if all that group and topic messaging works --- I haven't tried that part of it yet, myself.
According to the new and fancy GCM specs, the field
to
may hold a single registration id or a single notification key. This should be used when only a single registration id is sent.