Chats
public class Chats
Service to manage chat actions and subscribe to chat events
-
Data needed to create each type of chat
Declaration
Swift
public enum CreationType
-
Chats associated to active conferences
Declaration
Swift
public var currentConferenceChats: [Chat] { get }
-
Add a new
ChatsDelegate
Declaration
Swift
public func add(delegate: ChatsDelegate)
Parameters
delegate
delegate instance
-
Remove a
ChatsDelegate
Declaration
Swift
public func remove(delegate: ChatsDelegate)
Parameters
delegate
delegate to remove
-
Starts a new chat session, new messages are delivered once it’s connected
Declaration
Swift
public func startSession(completion: @escaping () -> Void)
Parameters
completion
completion block
-
Stops a chat session, this should be called when enters in background to receive pushes via apn
Declaration
Swift
public func stopSession(completion: @escaping () -> Void)
Parameters
completion
completion block
-
Reconnects a chat session, this should be called when enters in foreground to receive pushes via socket tcp
Declaration
Swift
public func reconnectSession(completion: @escaping () -> Void)
Parameters
completion
completion block
-
Enable push module to receive new chat notifications
Declaration
Swift
public func enablePushNotification(token: String, serverJID: String, completion: @escaping (Result<Void, ClientError>) -> Void)
Parameters
token
APNS token
serverJID
Server to register the push
completion
completion block
-
Disable push module to stop receiving new chat notifications
Declaration
Swift
public func disablePushNotification(serverJID: String, completion: @escaping (Result<Void, ClientError>) -> Void)
Parameters
serverJID
Server to register the push
completion
completion block
-
Create a new chat
Declaration
Swift
public func createChat(creationType: Chats.CreationType, result: @escaping (Result<Chat, ResourceError>) -> Void)
Parameters
creationType
Used to create a 1-1 chat or a group chat
result
Async result with
Chat
-
Fetch chats
Declaration
Swift
public func chats(types: [Chat.ChatType], result: @escaping (Result<[Chat], ResourceError>) -> Void)
Parameters
types
Filter by type (1-1 or group)
result
Async result with a list of
Chat