ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 208 forks source link

sending push notification to a group of devices #286

Closed nurulnabi closed 7 years ago

nurulnabi commented 7 years ago

I am new to gcm. while I was looking at node-gcm I found that notificationKey is deprecated. So I want to know how I can send notification to a group of devices?

eladnava commented 7 years ago

Device groups in FCM are not deprecated, it's just that the parameter notificationKey itself is deprecated.

You should instead use the to parameter:

sender.send(message, { to: notificatioKey }, function(err, response) {
  if(err) console.error(err);
  else    console.log(response);
});