简体   繁体   中英

Pubnub real-time communication

I am new to the socket communication concept and I have few basic questions.

We have server serving multiple clients WEB,MOBILE etc.. we want to implement real time changes in the web app (web app is consumer only)

Lets say that each user has it's own private channel and the channel name will be the UUID of the user.

How does the server side can keep track which users connected to their channel?

In our case there is no meaning to send message to a channel which no device is listning to.

  • I saw presence feature but I am not sure that is the way it seems more appropriate for many users which can connect to a single channel and not 1-1

Basically when the server is handling somekind of user related operation I need a way to know if someone is listning to that user channel.

How it can be done with pubnub?

Lets say I am sending a message to a channel no one is listen/suscribed to

  1. if no one consuming the msg pubnub will consider it in the usage?
  2. once device will connected to that channel the message will be consumed?

How does the server side can keep track which users connected to their channel?

PubNub offers Presence "Connect WebHooks" which you can ask your Account Manager to enable for you. Ask for "Presence Callback Active" and "Presence Callback Inactive" settings. You'll want to setup a dev/prod key pair to point the WebHook URLs at different environments.

The HTTP callback URL that is triggered when a channel becomes active.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM