Skip to main content

createFileMessageByURL

Description​

info

When you need to store resources yourself, upload the file via API and obtain the download URL, then call this API to create a file message.

Note

Messages created through this API must be sent via sendMessageNotOss.

Function Prototype​


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

Input Parameters​

Parameter NameParameter TypeRequiredDescription
fileURLNSStringYesAbsolute path
fileNameNSStringNoFile name
sizeNSIntegerYesFile size

Return Result​

NameTypeDescription
messageOIMMessageInfoSuccess return

Code Example​


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