Supported versions: 6.18.0 and above
When a consumer navigates to the conversation screen they cannot send a message right away, as they have to wait for connecting to the server and for the history to be retrieved first. With the release of the SDK version 6.18.0, we would like to introduce a new feature called Offline Messaging, which allows the consumer to start sending messages as soon as they open the conversation screen, without the need to wait until the connection is established.
Offline messages are messages that will be sent once connection with the server is established. To enable offline messages you need to set the offlineMessagingEnabled flag to true. All offline messages sent by consumers are added to local storage and will be attached to an active consumer conversation. If there is no active dialog SDK will request a new conversation to which all pending offline messages would be added.
Post-survey dialogs and offline messaging
As described previously, all pending messages would be attached to an active dialog, once a connection is established, but sometimes there is no need to do it if an active dialog is post-surveyed type. For that reason, SDK has a separate option for PCS dialogs.
In order to define this behavior the pcsBehaviorForOfflineMessages flag can be assigned to one of the following values:
- 1 - remove offline messages from dialog and do not send them to UMS, continue with PCS dialog.
- 2 - resolve active PCS dialog and send offline messages to a new conversation.
- 0 / other values - do nothing, just send offline messages to the same dialog
Limitations and rules.
- If an unauthenticated consumer sends messages while the SDK is not connected and sends the app to background while still connecting to the server, all offline messages will be discarded and won’t be sent to the server.
- Offline welcome message will not be shown on the agent side if it was added at the bottom of the conversation screen.
- When a consumer first navigates to the conversation screen or reopens the application, the actual conversation state is unknown until authentication is completed and a connection to the socket is established. During this connection phase, a welcome message may appear in the messaging window based on the host app configuration. To provide more control, we will introduce a brand attribute to manage the display of the welcome message during the offline message phase.