- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
Image message (ImageMessage) is a built-in SDK message type. Its contentType value is jg:img.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | String | Local image path. | 1.0.0 |
| url | String | Remote image URL. | 1.0.0 |
| thumbnailLocalPath | String | Local thumbnail path. | 1.0.0 |
| thumbnailUrl | String | Remote thumbnail URL. | 1.0.0 |
| height | int | Image height. | 1.0.0 |
| width | int | Image width. | 1.0.0 |
| size | long | Image size in Byte. | 1.0.0 |
| extra | String | Extension fields. | 1.0.0 |
Image message (JImageMessage) is a built-in SDK message type. Its contentType value is jg:img.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | NSString | Local image path. | 1.0.0 |
| url | NSString | Remote image URL. | 1.0.0 |
| thumbnailLocalPath | NSString | Local thumbnail path. | 1.0.0 |
| thumbnailUrl | NSString | Remote thumbnail URL. | 1.0.0 |
| height | int | Image height. | 1.0.0 |
| width | int | Image width. | 1.0.0 |
| size | long long | Image size in Byte. | 1.0.0 |
| extra | NSString | Extension fields. | 1.0.0 |
Image messages are built-in SDK message types. The corresponding enum is MessageType.IMAGE
| Property | Type | Description | Version |
|---|---|---|---|
| url | Number | Original image URL | 1.0.0 |
| thumbnail | Number | Thumbnail image URL. For UI display, use the width and height to render a placeholder and load the thumbnail first to avoid layout shifts after the image loads. | 1.0.0 |
| height | Number | Image height. | 1.0.0 |
| width | Number | Image width. | 1.0.0 |
| size | Number | Original image size, used to display progress when viewing or downloading, in KB | 1.0.0 |
| extra | String | Additional message content. JSON strings are supported and cannot be changed after setting. | 1.0.0 |
let imageMsg = {
url: "https://example.com/avatar.png",
thumbnail: "https://example.com/avatar_th.png",
height: 640,
width: 480,
size: 100,
extra: '{"Priority":"P0"}'
}
let message = {
conversationType: ConversationType.PRIVATE,
conversationId: 'userId1',
name: MessageType.IMAGE,
content: imageMsg
};
Image message (ImageMessage) is a built-in SDK message type. Its contentType value is jg:img.
| Property | Type | Description | Version |
|---|---|---|---|
| url | string | Remote image URL. | 1.0.0 |
| thumbnail | string | Remote thumbnail URL. | 1.0.0 |
| height | number | Image height. | 1.0.0 |
| width | number | Image width. | 1.0.0 |
| size | number | Image size in KB. | 1.0.0 |
| extra | string | Extension fields. | 1.0.0 |
Image message (ImageMessage) is a built-in SDK message type. Its contentType value is jg:img.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | String | Local image path. | 0.6.3 |
| url | String | Remote image URL. | 0.6.3 |
| thumbnailLocalPath | String | Local thumbnail path. | 0.6.3 |
| thumbnailUrl | String | Remote thumbnail URL. | 0.6.3 |
| height | int | Image height. | 0.6.3 |
| width | int | Image width. | 0.6.3 |
| size | int | Image size in Byte. | 0.6.3 |
| extra | String | Extension fields. | 0.6.3 |
Image message (ImageMessageContent) is a built-in SDK message type. Its contentType value is jg:img.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | string | Local image path. | 1.0.0 |
| url | string | Remote image URL. | 1.0.0 |
| thumbnailLocalPath | string | Local thumbnail path. | 1.0.0 |
| thumbnailUrl | string | Remote thumbnail URL. | 1.0.0 |
| height | number | Image height. | 1.0.0 |
| width | number | Image width. | 1.0.0 |
| size | number | Image size in Byte. | 1.0.0 |
| extra | string | Extension fields. | 1.0.0 |