IMClient

public class IMClient

IM Client

Property

Init

Open & Close

Create Conversation

  • Create a Normal Conversation. Default is a Normal Unique Conversation.

    Declaration

    Swift

    public func createConversation(
        clientIDs: Set<String>,
        name: String? = nil,
        attributes: [String: Any]? = nil,
        isUnique: Bool = true,
        completion: @escaping (LCGenericResult<IMConversation>) -> Void)
        throws

    Parameters

    clientIDs

    The set of client ID. it’s the members of the conversation which will be created. the initialized members always contains current client’s ID. if the created conversation is unique, and server has one unique conversation with the same members, that unique conversation will be returned.

    name

    The name of the conversation.

    attributes

    The attributes of the conversation.

    isUnique

    True means create or get a unique conversation, default is true.

    completion

    Result callback.

  • Create a Chat Room.

    Declaration

    Swift

    public func createChatRoom(
        name: String? = nil,
        attributes: [String: Any]? = nil,
        completion: @escaping (LCGenericResult<IMChatRoom>) -> Void)
        throws

    Parameters

    name

    The name of the chat room.

    attributes

    The attributes of the chat room.

    completion

    Result callback.

  • Create a Temporary Conversation. Temporary Conversation is unique in it’s Life Cycle.

    Declaration

    Swift

    public func createTemporaryConversation(
        clientIDs: Set<String>,
        timeToLive: Int32,
        completion: @escaping (LCGenericResult<IMTemporaryConversation>) -> Void)
        throws

    Parameters

    clientIDs

    The set of client ID. it’s the members of the conversation which will be created. the initialized members always contains this client’s ID.

    timeToLive

    The time interval for the life of the temporary conversation.

    completion

    Result callback.

Conversation Query

Conversation Memory Cache

Session Query

  • Query online state of clients, the ID in the result set means online.

    Declaration

    Swift

    public func queryOnlineClients(clientIDs: Set<String>, completion: @escaping (LCGenericResult<Set<String>>) -> Void) throws

    Parameters

    clientIDs

    The set of ID to be queried, count of IDs should in range 1…20.

    completion

    callback.

Local Storage