https://github.com/ToothlessGear/node-gcm/blob/master/lib/message-options.js
https://github.com/ToothlessGear/node-gcm/blob/master/lib/message.js
Use CURL to send push instead of libraries:
Write no break
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: key=AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx8' -d '{contentAvailable: true, data:{ "room_id":data.room_id, "noti_type":"NEW_MESSAGE", "badge":11, "count": 22, "content-available": "1"},registration_ids: 'dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTExxx',
priority: "high", collapse_key:"Updates Available" }' 'https://android.googleapis.com/gcm/send'
curl -X POST --header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: key=AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx' \
-d '{contentAvailable: true, data:{ "room_id":data.room_id, "noti_type":"NEW_MESSAGE", "badge":11, "count": 22, "content-available": "1"},registration_ids: 'dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0',
priority: "high" }' \
'https://android.googleapis.com/gcm/send'
// Add custom data (count)
curl -X POST \
-H "Authorization: key= AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57hX8" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [
"dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0"
],
"data": {
"message": "Hello Thunder",
"count": 22
},
"priority": "high"
}' \
https://android.googleapis.com/gcm/send
// fcm will replace gcm ?
curl -X POST \
-H "Authorization: key= AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [
"dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0"
],
"data": {
"message": "Hello Thunder",
"count": 23
},
"priority": "high"
}' \
https://fcm.googleapis.com/fcm/send
// Content-Type text//html cannot use with gcm api
curl -X POST \
-H "Authorization: key= AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx" \
-H "Content-Type: text/html" \
-d '{
"registration_ids": [
"dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0"
],
"data": {
"message": "Hello Thunder",
"count": 23
},
"priority": "high"
}' \
https://fcm.googleapis.com/fcm/send
https://www.npmjs.com/package/node-gcm
Send message using CURL
http://techqa.info/programming/question/21650446/Sending-GCM-push-in-Node
https://github.com/ToothlessGear/node-gcm/blob/master/lib/sender.js
http://corpus.hubwiz.com/2/node.js/21650446.html
https://github.com/ToothlessGear/node-gcm/blob/master/lib/message.js
Use CURL to send push instead of libraries:
Write no break
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: key=AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx8' -d '{contentAvailable: true, data:{ "room_id":data.room_id, "noti_type":"NEW_MESSAGE", "badge":11, "count": 22, "content-available": "1"},registration_ids: 'dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTExxx',
priority: "high", collapse_key:"Updates Available" }' 'https://android.googleapis.com/gcm/send'
curl -X POST --header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: key=AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx' \
-d '{contentAvailable: true, data:{ "room_id":data.room_id, "noti_type":"NEW_MESSAGE", "badge":11, "count": 22, "content-available": "1"},registration_ids: 'dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0',
priority: "high" }' \
'https://android.googleapis.com/gcm/send'
// Add custom data (count)
curl -X POST \
-H "Authorization: key= AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57hX8" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [
"dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0"
],
"data": {
"message": "Hello Thunder",
"count": 22
},
"priority": "high"
}' \
https://android.googleapis.com/gcm/send
// fcm will replace gcm ?
curl -X POST \
-H "Authorization: key= AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [
"dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0"
],
"data": {
"message": "Hello Thunder",
"count": 23
},
"priority": "high"
}' \
https://fcm.googleapis.com/fcm/send
// Content-Type text//html cannot use with gcm api
curl -X POST \
-H "Authorization: key= AIzaSyCyg6f6a8LCTqkN1HUG0xo5G0HlBA57xxx" \
-H "Content-Type: text/html" \
-d '{
"registration_ids": [
"dh5DjydSS08:APA91bGAnaldtOxSXX970NWO4SCl3QCzrz4mIp98yCi5St8xDZWT8KNJIwglusSwEVe1wEGZKcSH4RqXYfk6JXiK52sZ1SpS53rXNdg6n1R81lrfCdHYoPMOwC4MAQzVYS5VkkrTEkY0"
],
"data": {
"message": "Hello Thunder",
"count": 23
},
"priority": "high"
}' \
https://fcm.googleapis.com/fcm/send
https://www.npmjs.com/package/node-gcm
Send message using CURL
http://techqa.info/programming/question/21650446/Sending-GCM-push-in-Node
https://github.com/ToothlessGear/node-gcm/blob/master/lib/sender.js
http://corpus.hubwiz.com/2/node.js/21650446.html
Comments
Post a Comment