0
我已經用科爾多瓦推插件創建一個應用程序我的設備,但每次我要發送推送通知我必須獲得該設備的註冊ID和在我的APN中爲ios設置它。有沒有辦法自動保存ID? 這裏是我的APN節點服務器代碼:如何發送推送通知到所有使用科爾多瓦推插件
var apn = require('apn');
var options = { };
var token = 'Device Number';
var apnConnection = new apn.Connection(options);
var myDevice = new apn.Device(token);
var message = new apn.Notification();
message.expiry = Math.floor(Date.now()/1000) + 3600; // Expires 1hour from now.
message.badge = 1;
message.sound = "ping.aiff";
message.alert = "\uD83D\uDCE7 \u2709 You have a new message";
message.payload = {'messageFrom': 'Caroline'};
//Potentially get rid of the notification in pushNotification
apnConnection.pushNotification(message, myDevice);\
乾杯
好的,謝謝,我可以將它們全部保存在數組中嗎?如果是這樣,我會怎麼做? –