Delivered messages are handled differently depending on whether the receiver (User B) is online or offline.
The Receiver is Online: If the sender (User A) sends a message and the receiver (User B) is online, then the Hyphenate server delivers the message to the receiver (User B) directly.
The Receiver is Offline: If the sender (User A) sends a message and the receiver (User B) is offline, Hyphenate will send a push notification (APNs, FCM/GCM, etc) and queue up the offline message. The message will be delivered when the receiver (User B) is back online.
Message Storage Policy
Undelivered messages are stored on Hyphenate's server for up to 7 days.
Delivered messages are stored on Hyphenate's server for 3 days.
Please contact Hyphenate if you need to extend the storage time.
If you want peace of mind and do not want to deal with undelivered messages, should your users choose to leave the app for a few days and not receive any messages while away, then you can leverage the option of extending the message retention time duration with some marginal cost. see Message storage extension on Hyphenate server
To setup push notifications, please follow these guides:
Message Storage Policy
The standard message storage policy is 7 days for undelivered messages and 3 days for delivered messages, which means messages will be purged from the Hyphenate server if outside of these time periods.
- In order to analyze users' conversations or keep the message history permanently, you'll need to use REST API Get chat history API, to fetch and store users' chat history to the developer’s backend. Hyphenate server generates chat history downloadable package in hourly basis. As a result, call the API on hourly or daily basis to obtain the message history. See RESTful API in details.
- Files like image or video will be uploaded to Hyphenate prior to delivery, use REST API Get chat history API to file downloading url to get files and store them in your developer server Image, Video, and Thumbnail Handling.
For cases like chatbot integration or real-time language translation, the optimal solution is to set up Webhooks to receive the real-time messages as users interact.
One way to load message history when a user logs into a new device or scrolls to see old messages, is to fetch the message history stored in the developer backend instead of Hyphenate’s, since Hyphenate only stores message history for a limited time under the basic plan.
However, you can also leverage the message roaming feature provided by Hyphenate. It allows you to get message history from Hyphenate chat server via client SDK. By default, messages get stored for up to 7 days and up to 5,000 messages. The number of days and messages is configurable with a complimentary message storage extension service. see Message Roaming.
Hyphenate offers two options for message retention duration, 3-month or 6-month, on monthly basis. So instead of default 3 and 7 days of message storage, you can extend the message storage rolling up to 3 or 6 months with a monthly premium plan, which also allows you to expand the time duration of message roaming as the same as your message storage plan. Please contact Hyphenate