Skip to main content

createFileMessageByURL

Feature Introduction

Description

When you need to store resources yourself, you can upload the file via the API, obtain the download address, and then send the file message to the other party.

Note

The message created through this API must be sent using the sendMessageNotOss method.

Function Prototype


+ (OIMMessageInfo *)createFileMessageByURL:(NSString *)fileURL
fileName:(NSString * _Nullable)fileName
size:(NSInteger)size;

Input Parameters

Parameter NameParameter TypeMandatoryDescription
fileURLNSStringYesAbsolute path
fileNameNSStringNoFile name
sizeNSIntegerYesFile size

Return Result

NameTypeDescription
messageOIMMessageInfoSuccess return

Code Example


OIMMessageInfo *message = [OIMMessageInfo createFileMessageByURL:@"" fileName:nil, size:1];