goEasy. subscribe({
channel: 'csdnNotification',
onMessage: function(message){
alert('Meessage received:'+message.content);//接收到推送的消息
}
});
3. 后台往相同channel上推送. 用GoEasy提供的restful API实现 API url: http://goeasy.io/goeasy/publish 方式: Post 参数列表: channel: 'csdnNotification' //与订阅的channel必须一致,否则客户端将收不到消息。因此我们也可以根据channel来控制哪些客户端可以接收。 appkey: 'supper key' //这里必须使用supper key content: 'blabla…..' //要推送的内容 希望对大家有帮助。转载于:https://www.cnblogs.com/tuziaichihuluobopipi/p/6149018.html