forked from gregberge/node-apns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
29 lines (19 loc) · 759 Bytes
/
example.js
File metadata and controls
29 lines (19 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var apns = require("./index");
var options = {
keyFile : "conf/key.pem",
certFile : "conf/cert.pem",
debug : true
};
var connection = new apns.Connection(options);
var goodToken = "c5bf61a839855b92a394dc883433df64447a7fe7ed0d8ee121f97c9973628f32",
notification = new apns.Notification(),
device = new apns.Device(goodToken);
notification.alert = "Hello World (must not be sent) !";
notification.device = device;
var goodToken = "b5bf61a839855b92a394dc883433df64447a7fe7ed0d8ee121f97c9973628f32",
notification2 = new apns.Notification(),
device2 = new apns.Device(goodToken);
notification2.alert = "Hello World !";
notification2.device = device2;
connection.sendNotification(notification);
connection.sendNotification(notification2);