Skip to main content

insertSingleMessageToLocalStorage

Feature Introduction

Description

Inserts a single chat message locally.

Note

Visible only on the current device. Related Callback: onConversationChanged

Function Prototype


- (void)insertSingleMessageToLocalStorage:(OIMMessageInfo *)message
recvID:(NSString *)recvID
sendID:(NSString *)sendID
onSuccess:(nullable OIMMessageInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeRequiredDescription
messageOIMMessageInfoYesMessage body
recvIDNSStringYesUser ID receiving the message
sendIDNSStringYesUser ID sending the message

Return Results

NameTypeDescription
onSuccessOIMMessageInfoSuccessful return
onFailureOIMFailureCallbackFailed return

Code Example


[OIMManager.manager insertSingleMessageToLocalStorage:
recvID:@""
sendID:@""
onSuccess:^(OIMMessageInfo * _Nullable message) {

} onFailure:^(NSInteger code, NSString * _Nullable msg) {

}];