easemob-websdk 4.0.5 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -14
- package/Easemob-chat.d.ts +633 -38
- package/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/readme.md +13 -11
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -38,16 +38,18 @@ conn.open(options);
|
|
|
38
38
|
5、发送消息
|
|
39
39
|
|
|
40
40
|
```js
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
let option = {
|
|
42
|
+
chatType: 'singleChat', // 会话类型,设置为单聊。
|
|
43
|
+
type: 'txt', // 消息类型。
|
|
44
|
+
to: 'userID', // 消息接收方(用户 ID)。
|
|
45
|
+
msg: 'message content', // 消息内容。
|
|
46
|
+
};
|
|
47
|
+
let msg = websdk.message.create(option);
|
|
48
|
+
conn.send(msg)
|
|
49
|
+
.then(() => {
|
|
48
50
|
console.log('send private text Success');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
})
|
|
52
|
+
.catch((e) => {
|
|
53
|
+
console.log('Send private text error');
|
|
54
|
+
});
|
|
53
55
|
```
|