Skip to content

Commit e6e5079

Browse files
committed
update docs
1 parent 7c2e1c3 commit e6e5079

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

document/API.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import JMessage from 'jmessage-react-plugin';
4545
- [retractMessage](#retractmessage)
4646
- [getHistoryMessages](#gethistorymessages)
4747
- [downloadOriginalImage](#downloadoriginalimage)
48+
- [downloadThumbImage](#downloadthumbimage)
4849
- [downloadVoiceFile](#downloadvoicefile)
4950
- [downloadFile](#downloadfile)
5051
- [会话](#会话)
@@ -107,7 +108,7 @@ import JMessage from 'jmessage-react-plugin';
107108

108109

109110

110-
- [点击消息通知事件(Android Only)](#addclickmessagenotificationlistener)
111+
- [点击消息通知事件(Android Only)](#addclickmessagenotificationlistener)
111112
- [addClickMessageNotificationListener](#addclickmessagenotificationlistener)
112113
- [removeClickMessageNotificationListener](#addclickmessagenotificationlistener)
113114

@@ -946,6 +947,33 @@ JMessage.downloadOriginalImage({ type: 'single', username: 'username',
946947
- groupId: 对象群组 id。当 `type` 为 'group' 时,`groupId` 为必填。
947948
- messageId: 图片消息 id。
948949

950+
### downloadThumbImage
951+
952+
下载图片消息缩略图。如果已经下载,会直接返回本地文件路径,不会重复下载。
953+
954+
#### 示例
955+
956+
```js
957+
JMessage.downloadThumbImage({ type: 'single', username: 'username',
958+
messageId: 'target_msg_id' },
959+
(result) => {
960+
var msgId = result.messageId
961+
var imgPath = result.filePath
962+
963+
}, (error) => {
964+
var code = error.code
965+
var desc = error.description
966+
})
967+
```
968+
969+
#### 参数说明
970+
971+
- type: 会话类型。可以为 'single' 或 'group' 。
972+
- username: 对方用户的用户名。当 `type` 为 'single' 时,`username` 为必填。
973+
- appKey: 对方用户所属应用的 AppKey。如果不填,默认为当前应用。
974+
- groupId: 对象群组 id。当 `type` 为 'group' 时,`groupId` 为必填。
975+
- messageId: 图片消息 id。
976+
949977
### downloadVoiceFile
950978

951979
下载语音文件。如果已经下载,会直接返回本地文件路径,不会重复下载。

0 commit comments

Comments
 (0)