-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (27 loc) · 825 Bytes
/
app.js
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
30
31
PubNub = require('pubnub');
var pubnub = new PubNub({
publishKey: 'pub-c-3cc11672-df14-4156-a631-24f9511fb645',
subscribeKey: 'sub-c-9943bb22-fa5e-11e5-8180-0619f8945a4f',
})
pubnub.publish(
{
message: {
"pn_gcm": {
"data" : {
"riders" : "hello my message is sending"
}
}
},
channel: 'rider.de2b0e08-2bad-447f-a695-3554b063ae92',
sendByPost: false, // true to send via post
storeInHistory: false, //override default storage options
},
function (status, response) {
if (status.error) {
// handle error
console.log(status)
} else {
console.log("message Published w/ timetoken", response.timetoken)
}
}
);