The community forums are in BETA and closed to the public.

Are messages (text) sent by publisher saved on the server if the subscriber is offline?

I am building a 1:1 private chat app. both want send and receive messages. An end point publish on one channel that is subscribed by the other end point. If one end point is not connected or is offline, can the other end point publish messages? Are the messages saved until they are delivered to the other end point when it comes online and connected. How long are the messages saved? Our solution requires a sender can send messages to a given user even if the user (receiver) is not currently connected. In SMS and XMPP deliver, servers store messages for certain period of time if the receiver is not reachable immediately, and when the receiver is connected back to the network before that certain time the message is delivered. Does PubNub model support this?

If one end point is not connected or is offline, can the other end point publish messages?

Yes, there is no direct connection between publishers and subscribers. They are completely decoupled. So there is no dependency on subscribers being on a channel for another user to publish a message.

Are the messages saved until they are delivered to the other end point when it comes online and connected. How long are the messages saved?

You just need to enable the Storage & Playback add-on for your key in the PubNub Dashboard. You can set the storage duration period to be 1 to 30 days or forever for Global Network account. When a subscriber is offline, messages will be persisted. When a subscriber comes back online, you can retrieve the missed messages by calling history and use a timetoken that respesent the last time a message was received by that subscriber on that channel. See this video FAQ about history for more details.

Let us know if you still have further questions.


Comments to this discussion are now closed!