SDKsAndroid
Create an image message from URLs
Use createImageMessageByURL to create an image message for an uploaded resource.
Prepare the original, large, and thumbnail PictureInfo values before creating the message.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceURL | String | Yes | Remote URL of the uploaded original image. |
sourcePicture | PictureInfo | Yes | URL, dimensions, size, and type of the original image. |
bigPicture | PictureInfo | Yes | Large-image data; provide usable image information when no separate large image exists. |
snapshotPicture | PictureInfo | Yes | Thumbnail data used in lists and previews. |
Message message = OpenIMClient.getInstance().messageManager.createImageMessageByURL(
sourceURL, sourcePicture, bigPicture, snapshotPicture);The returned Message contains metadata for an uploaded image and does not upload the file again. Verify that recipients can access every URL, then use Send an uploaded media message.
Was this page helpful?