最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Sending android push notification through node.js - Stack Overflow

programmeradmin4浏览0评论

I have recently been trying to send push notification to my android and ios devices. For ios I found that node-apn module will be used for handling this,but for android I haven't e across anything of that sort. Any help will be much appreciated.

I have recently been trying to send push notification to my android and ios devices. For ios I found that node-apn module will be used for handling this,but for android I haven't e across anything of that sort. Any help will be much appreciated.

Share Improve this question edited Feb 24, 2016 at 19:39 Muhammad Reda 27k14 gold badges98 silver badges106 bronze badges asked Dec 18, 2012 at 6:48 Amanda GAmanda G 1,98111 gold badges33 silver badges44 bronze badges 1
  • Did you got the solution for this. I want node.js RESTful api for sending notification to mobile devices so that I can make use the services. – Vinod Kumar Marupu Commented Jun 28, 2016 at 12:55
Add a ment  | 

2 Answers 2

Reset to default 6

There is another alternative; android-gcm. It is super easy to use.

Code sample from documentation:

var gcm = require('android-gcm');

// initialize new androidGcm object 
var gcmObject = new gcm.AndroidGcm('API_KEY');

// create new message 
var message = new gcm.Message({
    registration_ids: ['x', 'y', 'z'],
    data: {
        key1: 'key 1',
        key2: 'key 2'
    }
});

// send the message 
gcmObject.send(message, function(err, response) {});

Check these solutions for more info.

https://github./SpeCT/node-c2dm

https://github./Instagram/node2dm

https://npmjs/package/pushover

发布评论

评论列表(0)

  1. 暂无评论