2013-02-06 2 views

답변

10

node-apn v1.3.x (매우 권장되는 업그레이드)를 사용하면 많은 장치에 동일한 통지를 필요없이 보낼 수있다. 루프. 이 모듈은 자동으로 하나의 알림을 여러 기기에 전송하는 복잡한 작업을 처리합니다.

// Instantiate a new message 
// and set message defaults 
var note = new apns.Notification(); 
note.expiry = Math.floor(Date.now()/1000) + 3600; // Expires 1 hour from now. 
note.badge = 3; 
note.sound = "ping.aiff"; 
note.alert = "You have a new message"; 
note.payload = {'messageFrom': 'Caroline'}; 

// List of user tokens 
var userTokens = ['token1', 'token2', 'token3']; 
// Send the message 
apnsConnection.pushNotification(note, userTokens); 
+0

답장을 보내 주셔서 감사합니다. :) 단지 몇 가지 토큰을 배열에 넣을 수 있습니까? 제한이 있습니까? –

+0

아무런 문제가 없으면 제한이 없어야합니다. – argon

+0

끝내 주셔서 감사합니다. 이제 그게 작은 문제가 될 수있는 방법을 봅니다. 귀하의 답변을 수정하려면 답변을 삭제하겠습니다. –

관련 문제