Skip to main content

sendMessageNotOss

Feature Introduction

Description

Send a message.

Note

You need to first invoke createXXXMessage to create a message. Messages created by createXXXMessageByURL must be sent through this interface. Related Callbacks: onConversationChanged onRecvNewMessage onRecvNewMessages

Function Prototype


- (void)sendMessageNotOss:(OIMMessageInfo *)message
recvID:(NSString * _Nullable)recvID
groupID:(NSString * _Nullable)groupID
offlinePushInfo:(OIMOfflinePushInfo * _Nullable)offlinePushInfo
onSuccess:(nullable OIMMessageInfoCallback)onSuccess
onProgress:(nullable OIMNumberCallback)onProgress
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameParameter TypeRequiredDescription
messageOIMMessageInfoYesMessage body
recvIDNSStringNoUser ID of the message recipient
groupIDNSStringNoGroup ID of the message recipient
offlinePushInfoOIMOfflinePushInfoNoOffline message body

Return Result

NameTypeDescription
onSuccessOIMMessageInfoSuccessful return
onProgressNSIntegerSending progress
onFailureOIMFailureCallbackFailed return

Code Example


OIMMessageInfo *testMessage = [OIMMessageInfo createSoundMessageByURL:@"https://xxx"
duration:1
size:1];

[OIMManager.manager sendMessageNotOss:testMessage
recvID:@""
groupID:@""
offlinePushInfo:nil
onSuccess:^(OIMMessageInfo * _Nullable message) {
} onProgress:^(NSInteger number) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];