File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ < script src ="http://cdn.pubnub.com/pubnub-dev.js "> </ script >
2
+ < script >
3
+
4
+ // INIT PubNub
5
+
6
+ var pubnub = PUBNUB . init ( {
7
+ publish_key : 'demo-36' ,
8
+ publish_key : 'demo-36' ,
9
+ secret_key : 'demo-36' ,
10
+ uuid : "subWithHB"
11
+ } ) ;
12
+
13
+
14
+ pubnub . subscribe ( {
15
+ 'channel' : Math . floor ( ( Math . random ( ) * 1000 ) + 1 ) + 'a.*' ,
16
+ 'callback' : function ( r ) {
17
+ console . log ( JSON . stringify ( r ) ) ;
18
+ } ,
19
+ 'presence' : function ( r ) {
20
+ console . log ( JSON . stringify ( r ) ) ;
21
+ } ,
22
+ 'error' : function ( r ) {
23
+ console . log ( JSON . stringify ( r ) ) ;
24
+ } ,
25
+ 'disconnect' : function ( r ) {
26
+ console . log ( 'DISCONNECT ' + JSON . stringify ( r ) ) ;
27
+ } ,
28
+ 'reconnect' : function ( r ) {
29
+ console . log ( 'RECONNECT ' + JSON . stringify ( r ) ) ;
30
+ } ,
31
+ 'connect' : function ( r ) {
32
+ console . log ( 'CONNECT ' + JSON . stringify ( r ) ) ;
33
+ } ,
34
+ heartbeat : 10
35
+ } )
36
+
37
+
38
+
39
+
40
+ </ script >
You can’t perform that action at this time.
0 commit comments