成功显示已发送的通知,但未显示

时间:2018-10-17 13:28:05

标签: node.js apple-push-notifications node-apn

用于发送Safari通知的apn,它正在显示带有设备令牌的已发送数组,但未显示。

var apn = require("apn");
let options = {
cert: "./certificate.pem",
key: "./pushcert.pem",
production: true
};
let apnProvider = new apn.Provider(options);

var notification = new apn.Notification();

notification.expiry = Math.floor(Date.now() / 1000) + 3600  24  7;
//notification.body = "hello";
notification.badge=3;
notification.payload={"message":"ssss"}
// notification.title = title;
notification.alert="hi";
notification.topic = "";
notification.urlArgs = [];
apnProvider.send(notification,['xxxxxx','xxxx']).then( result => {
console.log(result);
});

apnProvider.shutdown();

0 个答案:

没有答案