agora-chat
Advanced tools
Comparing version 1.0.2 to 1.0.4
# Changes to Agora chat | ||
## 1.0.4 (May 25, 2022) | ||
- Add chatThread feature | ||
- Add the API to the session list to parse the last message | ||
- Modify the implementation of obtaining roaming messages | ||
- Add the mark of offline message in the message | ||
## 1.0.3 (April 19, 2022) | ||
- Add presence feature | ||
- Add translation feature | ||
- Fixed failure to modify desc when creating a group | ||
- Fixed SSR compatibility | ||
## 1.0.2 (January 19, 2022) | ||
- Fix 'renewtoken' failed to replace the token | ||
- Add 'downloadGroupSharedFile' api | ||
- 'fetchGroupSharedFileList' supports paging | ||
- Fix 'renewtoken' failed to replace the token | ||
- Add 'downloadGroupSharedFile' api | ||
- 'fetchGroupSharedFileList' supports paging | ||
## 1.0.1 (January 14, 2022) | ||
- Add delete session api | ||
- Add field 'buildingName' to the location message | ||
- Add restrictions on messages sent by non-friends | ||
- Add the error event of sending failure due to global mute | ||
- Fix missing onChannelMessage callback | ||
- Fix some known bugs | ||
- Add delete session api | ||
- Add field 'buildingName' to the location message | ||
- Add restrictions on messages sent by non-friends | ||
- Add the error event of sending failure due to global mute | ||
- Fix missing onChannelMessage callback | ||
- Fix some known bugs | ||
## 1.0.0 (December 10, 2021) | ||
- 1.0.0 version init | ||
- 1.0.0 version init |
{ | ||
"name": "agora-chat", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "Agora chat websdk", | ||
@@ -12,2 +12,2 @@ "main": "Agora-chat", | ||
"license": "ISC" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # Agora chat sdk Introduction | ||
---------- | ||
--- | ||
@@ -13,23 +13,26 @@ ## Chat SDK can be integrated in the following way: | ||
``` | ||
npm install easemob-websdk --save | ||
npm install agora-chat --save | ||
``` | ||
2. Import websdk | ||
``` | ||
import websdk from 'easemob-websdk' | ||
import websdk from 'agora-chat' | ||
``` | ||
3. Initialize the SDK | ||
```js | ||
const WebIM = {} | ||
const conn = WebIM.conn = new websdk.connection({ | ||
appKey: 'your app key' | ||
}) | ||
const WebIM = {}; | ||
const conn = (WebIM.conn = new websdk.connection({ | ||
appKey: 'your app key', | ||
})); | ||
``` | ||
4. Login chat server | ||
```js | ||
const options = { | ||
user: 'username', | ||
pwd: 'password' | ||
const options = { | ||
user: 'username', | ||
pwd: 'password', | ||
}; | ||
@@ -40,21 +43,18 @@ conn.open(options); | ||
5. Send a message | ||
```js | ||
let id = conn.getUniqueId() | ||
let msg = new WebIM.message('txt', id); | ||
msg.set({ | ||
msg: 'message content', | ||
to: 'username', | ||
chatType: 'singleChat', | ||
success: function () { | ||
console.log('send private text Success'); | ||
}, | ||
fail: function(e){ } | ||
}); | ||
conn.send(msg.body); | ||
let option = { | ||
chatType: 'singleChat', | ||
type: 'txt', | ||
to: 'userID', | ||
msg: 'message content', | ||
}; | ||
let msg = websdk.message.create(option); | ||
conn.send(msg) | ||
.then(() => { | ||
console.log('send private text Success'); | ||
}) | ||
.catch((e) => { | ||
console.log('Send private text error'); | ||
}); | ||
``` | ||
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
495027
5987