PubNub. Presence leave trigger event doesn't fire -


i'm testing pubnub 3.7.1. have problem leave event trigger doesn't fired.

i can see join , timeout trigger event. here code use:

pubnub.subscribe({     channel: 'channel',     presence: manageusers,     message: showmessage });  function manageusers(message, event, channel) {     console.log(message); } 

what problem?

thanks.

udate:

another thing when enter in channel there people connected, can't presence data. can presence data new users.

here example: http://plnkr.co/edit/qlqhb677czhter8sa52x?p=preview

your code works expected.

when user join, triggers 'join' action, , when user goes idle, action becomes 'timeout'.

the 'leave' action occurs when user unsubcribe channel.

e.g.

byebutton.click(function(){   pubnub.unsubscribe({     channel : 'channel_1',     callback: function(m){         console.log(m.action); // should print 'leave'     }  }); }); 

see more at: https://www.pubnub.com/docs/javascript/api/reference.html#unsubscribe


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -