大佬教程收集整理的这篇文章主要介绍了任何人使用Node.js与Amazon SNS和Apple Push Notifications?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
因此,以下工作是将单个消息发送到单个客户端.如果你想发送大量的东西,不能确定你可以做到这一点.也不知道你如何处理苹果的反馈,你应该检查失败的发送.
config = require("./config.js").config; var token = "1234567898123456789"; var AWS = require('aws-sdk'); AWs.config.update({accessKeyId: config.AWSAccessKeyId,secretAccessKey: config.AWSSecretKey}); AWs.config.update({region: config.AWSRegion}); var sns = new AWs.SNS(); var params = {'PlatformApplicationArn':config["AWSTargetARN"],'Token':token}; var message = 'Test'; var subject = 'stuff'; sns.createPlatformEndpoint(params,function(err,EndPointResult) { var client_arn = EndPointresult["EndpointArn"]; sns.publish({ TargetArn: client_arn,message: message,Subject: subject},data){ if (err) { console.log("Error sending a message "+err); } else { console.log("Sent message: "+data.messagEID); } }); });
以上是大佬教程为你收集整理的任何人使用Node.js与Amazon SNS和Apple Push Notifications?全部内容,希望文章能够帮你解决任何人使用Node.js与Amazon SNS和Apple Push Notifications?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。