LCIMClient
Objective-C
@interface LCIMClient : NSObject
Swift
class LCIMClient : NSObject
IM Client.
-
Set up connecting timeout, default is
60seconds.Declaration
Objective-C
+ (void)setTimeoutIntervalInSeconds:(NSTimeInterval)seconds;Swift
class func setTimeoutIntervalInSeconds(_ seconds: TimeInterval)Parameters
secondsThe interval of timeout.
-
The delegate for
LCIMClientDelegate.Declaration
Objective-C
@property (nonatomic, weak, nullable) id<LCIMClientDelegate> delegate;Swift
weak var delegate: LCIMClientDelegate? { get set } -
The delegate for
LCIMSignatureDataSource.Declaration
Objective-C
@property (nonatomic, weak, nullable) id<LCIMSignatureDataSource> signatureDataSource; -
The ID of this client.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull clientId;Swift
var clientId: String { get } -
The tag of this client.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *tag;Swift
var tag: String? { get } -
The current status of this client, see
LCIMClientStatus.Declaration
Objective-C
@property (nonatomic, readonly) LCIMClientStatus status;Swift
var status: LCIMClientStatus { get } -
The control switch for message query cache, default is
true.Declaration
Objective-C
@property (nonatomic) BOOL messageQueryCacheEnabled;Swift
var messageQueryCacheEnabled: Bool { get set } -
Unavailable
Undocumented
Declaration
Objective-C
+ (instancetype)new NS_UNAVAILABLE; -
Unavailable
Undocumented
Declaration
Objective-C
- (instancetype)init NS_UNAVAILABLE; -
Initializing with an ID.
Declaration
Objective-C
- (nullable instancetype)initWithClientId:(nonnull NSString *)clientId error:(NSError *_Nullable *_Nullable)error;Swift
init(clientId: String) throwsParameters
clientIdThe length of the ID should in range
[1, 64].errorThrows exception when error occurred.
-
Initializing with an ID and an option.
Declaration
Objective-C
- (nullable instancetype)initWithClientId:(nonnull NSString *)clientId option:(LCIMClientOption *_Nullable)option error:(NSError *_Nullable *_Nullable)error;Swift
init(clientId: String, option: LCIMClientOption?) throwsParameters
clientIdThe length of the ID should in range
[1, 64].optionSee
LCIMClientOption.errorThrows exception when error occurred.
-
Initializing with an ID and a tag.
Declaration
Objective-C
- (nullable instancetype)initWithClientId:(nonnull NSString *)clientId tag:(NSString *_Nullable)tag error:(NSError *_Nullable *_Nullable)error;Swift
init(clientId: String, tag: String?) throwsParameters
clientIdThe length of the ID should in range
[1, 64].tagUsing a tag to specify the context,
@"default"is reserved.errorThrows exception when error occurred.
-
Initializing with an ID, a tag and an option.
Declaration
Objective-C
- (nullable instancetype)initWithClientId:(nonnull NSString *)clientId tag:(NSString *_Nullable)tag option:(LCIMClientOption *_Nullable)option error:(NSError *_Nullable *_Nullable)error;Swift
init(clientId: String, tag: String?, option: LCIMClientOption?) throwsParameters
clientIdThe length of the ID should in range
[1, 64].tagUsing a tag to specify the context,
@"default"is reserved.optionSee
LCIMClientOption.errorThrows exception when error occurred.
-
Initializing with an
LCUserand an option.Declaration
Objective-C
- (nullable instancetype)initWithUser:(nonnull LCUser *)user option:(LCIMClientOption *_Nullable)option error:(NSError *_Nullable *_Nullable)error;Swift
init(user: LCUser, option: LCIMClientOption?) throwsParameters
userThe user should have logged in.
optionSee
LCIMClientOption.errorThrows exception when error occurred.
-
Initializing with an
LCUserand a tag.Declaration
Objective-C
- (nullable instancetype)initWithUser:(nonnull LCUser *)user tag:(NSString *_Nullable)tag error:(NSError *_Nullable *_Nullable)error;Swift
init(user: LCUser, tag: String?) throwsParameters
userThe user should have logged in.
tagUsing a tag to specify the context,
@"default"is reserved.errorThrows exception when error occurred.
-
Initializing with an
LCUser, a tag and an option.Declaration
Objective-C
- (nullable instancetype)initWithUser:(nonnull LCUser *)user tag:(NSString *_Nullable)tag option:(LCIMClientOption *_Nullable)option error:(NSError *_Nullable *_Nullable)error;Swift
init(user: LCUser, tag: String?, option: LCIMClientOption?) throwsParameters
userThe user should have logged in.
tagUsing a tag to specify the context,
@"default"is reserved.optionSee
LCIMClientOption.errorThrows exception when error occurred.
-
Open this client before using instant messaging service, this action use
LCIMClientOpenOptionForceOpenas default open option.Declaration
Objective-C
- (void)openWithCallback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;Swift
func open(callback: @escaping (Bool, Error?) -> Void)Parameters
callbackThe result callback.
-
Open this client before using instant messaging service
Declaration
Objective-C
- (void)openWithOption:(LCIMClientOpenOption)openOption callback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;Swift
func open(with openOption: LCIMClientOpenOption, callback: @escaping (Bool, Error?) -> Void)Parameters
openOptionSee
LCIMClientOpenOption.callbackThe result callback.
-
Close this client.
Declaration
Objective-C
- (void)closeWithCallback:(nonnull void (^)(BOOL, NSError *_Nullable))callback;Swift
func close(callback: @escaping (Bool, Error?) -> Void)Parameters
callbackThe result callback.
-
Create a Normal Conversation. Default is a Normal Unique Conversation.
Declaration
Objective-C
- (void)createConversationWithClientIds:(nonnull NSArray<NSString *> *)clientIds callback:(nonnull void (^)( LCIMConversation *_Nullable, NSError *_Nullable))callback;Swift
func createConversation(withClientIds clientIds: [String], callback: @escaping (LCIMConversation?, Error?) -> Void)Parameters
clientIdsThe 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.
callbackResult callback.
-
Create a Normal Conversation. Default is a Normal Unique Conversation.
Declaration
Objective-C
- (void) createConversationWithClientIds:(nonnull NSArray<NSString *> *)clientIds option:(LCIMConversationCreationOption *_Nullable) option callback: (nonnull void (^)(LCIMConversation *_Nullable, NSError *_Nullable))callback;Swift
func createConversation(withClientIds clientIds: [String], option: LCIMConversationCreationOption?, callback: @escaping (LCIMConversation?, Error?) -> Void)Parameters
clientIdsThe 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.
optioncallbackResult callback.
-
Create a Chat Room.
Declaration
Objective-C
- (void)createChatRoomWithCallback: (nonnull void (^)(LCIMChatRoom *_Nullable, NSError *_Nullable))callback;Swift
func createChatRoom(callback: @escaping (LCIMChatRoom?, Error?) -> Void)Parameters
callbackResult callback.
-
Create a Chat Room.
Declaration
Objective-C
- (void)createChatRoomWithOption: (LCIMConversationCreationOption *_Nullable)option callback:(nonnull void (^)(LCIMChatRoom *_Nullable, NSError *_Nullable))callback;Swift
func createChatRoom(with option: LCIMConversationCreationOption?, callback: @escaping (LCIMChatRoom?, Error?) -> Void)Parameters
optioncallbackResult callback.
-
Create a Temporary Conversation. Temporary Conversation is unique in it’s Life Cycle.
Declaration
Objective-C
- (void)createTemporaryConversationWithClientIds: (nonnull NSArray<NSString *> *)clientIds callback: (nonnull void (^)( LCIMTemporaryConversation *_Nullable, NSError *_Nullable))callback;Swift
func createTemporaryConversation(withClientIds clientIds: [String], callback: @escaping (LCIMTemporaryConversation?, Error?) -> Void)Parameters
clientIdsThe set of client ID. it’s the members of the conversation which will be created. the initialized members always contains this client’s ID.
callbackResult callback.
-
Create a Temporary Conversation. Temporary Conversation is unique in it’s Life Cycle.
Declaration
Objective-C
- (void)createTemporaryConversationWithClientIds: (nonnull NSArray<NSString *> *)clientIds option:(LCIMConversationCreationOption *_Nullable)option callback: (nonnull void (^)( LCIMTemporaryConversation *_Nullable, NSError *_Nullable))callback;Swift
func createTemporaryConversation(withClientIds clientIds: [String], option: LCIMConversationCreationOption?, callback: @escaping (LCIMTemporaryConversation?, Error?) -> Void)Parameters
clientIdsThe set of client ID. it’s the members of the conversation which will be created. the initialized members always contains this client’s ID.
optioncallbackResult callback.
-
Get a Exist Conversation Retained by this Client. Thread-safe & Sync.
Declaration
Objective-C
- (LCIMConversation *_Nullable)conversationForId: (nonnull NSString *)conversationId;Swift
func conversation(forId conversationId: String) -> LCIMConversation?Parameters
conversationIdconversationId
Return Value
if the Conversation Exist, return the Instance; if not, return nil.
-
Get Conversations Retained by this Client. Thread-safe & Async.
Declaration
Objective-C
- (void)getConversationsFromMemoryWith: (nonnull NSArray<NSString *> *)conversationIds callback: (nonnull void (^)(NSArray<LCIMConversation *> *_Nullable))callback;Swift
func getConversationsFromMemory(with conversationIds: [String], callback: @escaping ([LCIMConversation]?) -> Void)Parameters
conversationIdsID array.
callbackResult.
-
Remove Conversations Retained by this Client. Thread-safe & Async.
Declaration
Objective-C
- (void)removeConversationsInMemoryWith: (nonnull NSArray<NSString *> *)conversationIds callback:(nonnull void (^)(void))callback;Swift
func removeConversationsInMemory(with conversationIds: [String], callback: @escaping () -> Void)Parameters
conversationIdsArray of conversation’s ID
callbackResult of Callback, always means success.
-
Remove all Conversations Retained by this Client. Thread-safe & Async.
Declaration
Objective-C
- (void)removeAllConversationsInMemoryWith:(nonnull void (^)(void))callback;Swift
func removeAllConversationsInMemory(_ callback: @escaping () -> Void)Parameters
callbackResult of Callback, always means success.
-
Undocumented
Declaration
Objective-C
- (LCIMConversation * _Nullable)conversationWithKeyedConversation:(LCIMKeyedConversation *)keyedConversation;Swift
func conversation(with keyedConversation: LCIMKeyedConversation) -> LCIMConversation? -
Create a new conversation query.
Declaration
Objective-C
- (nonnull LCIMConversationQuery *)conversationQuery;Swift
func conversationQuery() -> LCIMConversationQuery -
Undocumented
Declaration
Objective-C
- (void)queryOnlineClientsInClients:(nonnull NSArray<NSString *> *)clients callback: (nonnull void (^)(NSArray<NSString *> *_Nullable, NSError *_Nullable))callback;Swift
func queryOnlineClients(inClients clients: [String], callback: @escaping ([String]?, Error?) -> Void)
View on GitHub
Install in Dash
LCIMClient Class Reference