Inviting Members
Overview
This guide covers inviting users to a conversation (members), listening for invites to join a conversation as well as new members joining.
Before you begin, make sure you added the SDK to your app and you are able to create a conversation.
NOTE: A step-by-step tutorial to build a chat application is available here.
This guide will introduce you to the following concepts.
- Invites - you can invite users to a conversation
- Application Events -
member:invitedevents that fire on an Application, before you are a Member of a Conversation - Conversation Events -
member:joinedandtextevents that fire on a Conversation, after you are a Member
Listening for Conversation invites and accepting them
Achieved by adding a listener on the application object for the member:invited event:
Add NXMClientDelegate as an extension to a ViewController or similar, and implement client(_ client: NXMClient, didReceive conversation: NXMConversation):
Note: The first 2 methods below are required when implementing NXMClientDelegate:
Have a ViewController, or similar, conform to NXMClientDelegate and implement client:didReceiveConversation::
Note: The first 2 methods below are required when implementing NXMClientDelegate:
Listening for members who joined a conversation
Listen for the member:joined event on the conversation:
Add NXMConversationDelegate as an extension to a ViewController or similar, and implement conversation(_ conversation: NXMConversation, didReceive event: NXMMemberEvent):
Note: The first method below is required when implementing NXMConversationDelegate:
Have a ViewController, or similar, conform to NXMConversationDelegate and implement conversation:didReceiveImageEvent::
Note: The first method below is required when implementing NXMConversationDelegate:
Inviting users to a conversation
Users can be invited to join conversation - their username will be used: