Using more Events with the Client SDK
In this guide we'll cover adding more conversation events; we'll deal with multiple types of events, the ones that come via the conversation, and the ones we send to the conversation.
Concepts
This guide will introduce you to the following concepts.
- Conversation Events -
member:leftandtext:events that fire on a Conversation when someone does an Action - Conversation Actions - actions that trigger events on a Conversation
- Conversation History - an
eventsobject that stores all text Events happening on a conversation
NOTE: A step-by-step tutorial to build a chat application is available here.
The getEvents method retrieves all the events that occurred in the context of the conversation. It returns a subset or "page" of events with each invocation - the number of events it returns is based on the page_size parameter (the default is 10 results, the maximum is 100).
Note: See the documentation for helper methods you can use to work with this paginated data.
The getEventsPageWithSize:order:completionHandler: method on NXMConversation retrieves all the events that occurred in the context of the conversation. It returns a subset or page of events with each invocation - the number of events it returns is based on the page_size parameter (the default is 10 results, the maximum is 100).
Below is an example of using the function to retrieve member and text events followed by using the conversation to send a text event. You can find out more about the supported event types in the Conversation API documentation.
The getEventsPageWithSize:order:completionHandler: method on NXMConversation retrieves all the events that occurred in the context of the conversation. It returns a subset or page of events with each invocation - the number of events it returns is based on the page_size parameter (the default is 10 results, the maximum is 100).
Below is an example of using the function to retrieve member and text events followed by using the conversation to send a text event. You can find out more about the supported event types in the Conversation API documentation.