Azure移动服务(推送通知)

时间:2016-03-08 06:58:42

标签: c# azure push-notification azure-notificationhub

我正在处理Azure移动服务推送通知,我正在尝试发送特定注册ID的推送通知。我有以下脚本,有人可以告诉我如何更新此JavaScript以便它正常工作:

exports.post = function(request, response) {

   var push = request.service.push;       
   var token="APA91bG7pOV2jLiSiSujNS4Gg_Q##################";
   var mes = "Hellooooo";
   var payload = '{"data":{"message" : "Testing"}}';

   push.gcm.send(null,payload,{
        success: function(pushResponse) {
            console.log("Sent push:", pushResponse, payload);
            request.respond();
            },              
        error: function (pushResponse) {
            console.log("Error Sending push:", pushResponse);
            request.respond(500, { error: pushResponse });
            }
        });
};

0 个答案:

没有答案