forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.html
More file actions
29 lines (26 loc) · 682 Bytes
/
Copy pathsimple.html
File metadata and controls
29 lines (26 loc) · 682 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
<div id=pubnub></div>
<script src="../pubnub.js"></script>
<script>(function(){
// INIT PubNub
console.log(PUBNUB);
var pubnub = PUBNUB.init({
publish_key : 'demo',
subscribe_key : 'demo',
ssl : true,
jsonp : false
});
pubnub.subscribe({
callback : console.log,
error : console.log,
channel : "abcd,xyz",
metadata : { "abcd" : {"age" : 30}, "xyz" : { "age" : 50 } },
heartbeat : 15
})
setTimeout(function(){
pubnub.state({
callback : console.log,
channel : "xyz",
metadata : { "age" : 100}
});
}, 30000);
})();</script>