Skip to main content

createImageMessageByURL

Feature Introduction

Description

When you need to store resources yourself, you can upload images through the API, obtain a download address, and then create an image message to send to the recipient.

Note

The message created through this API must be sent via sendMessageNotOss.

Function Prototype


+ (OIMMessageInfo *)createImageMessageByURL:(NSString *)sourcePath
sourcePicture:(OIMPictureInfo *)source
bigPicture:(OIMPictureInfo *)big
snapshotPicture:(OIMPictureInfo *)snapshot;

Input Parameters

Parameter NameParameter TypeRequiredDescription
sourcePathStringYesAbsolute path of the image on the device. If not available, pass an empty string.
sourceOIMPictureInfoYesInformation related to the original image
bigOIMPictureInfoYesInformation related to the large image
snapshotOIMPictureInfoYesInformation related to the thumbnail image

Return Result

NameTypeDescription
messageOIMMessageInfoSuccessful Return

Code Example


OIMPictureInfo *source = [OIMPictureInfo new];
source.url = @"";
OIMPictureInfo *big = [OIMPictureInfo new];
big.url = @"";
OIMPictureInfo *snapshot = [OIMPictureInfo new];
snapshot.url = @"";

OIMMessageInfo *message = [OIMMessageInfo createImageMessageByURL:sourcePath sourcePicture:source bigPicture:big snapshotPicture:snapshot];