Skip to content

Commit

Permalink
Merge pull request #3863 from haoxiuwen/agora-chat
Browse files Browse the repository at this point in the history
Modify Agora Chat Token CN Doc
  • Loading branch information
haoxiuwen authored Dec 13, 2024
2 parents 171e887 + 4e01f32 commit c9f625c
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 2 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## v1.3.1

v1.3.1 was released on XXXX, 2024.

#### Improvements

- Added the support for pinning messages in one-to-one conversations. Users can call `ChatManager#asyncPinMessage` or `ChatManager#asyncUnPinMessage` to pin or unpin a one-to-one chat message.

- Adapted to the 16 KB page size of Android 15.

#### Issues fixed

- A crash occurs when `to` is empty during message sending.
- An incorrect nextkey is returned when pulling roaming messages.
- A crash occurs when `CustomMessageBody#setParams` is called repeatedly in multi-thread scenarios.
- The number of unread messages is inconsistent among multiple devices in certain scenarios.
- The specified image thumbnail size does not take effect during message sending.


Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## v1.3.1

#### Improvements

- Added the support for pinning messages in one-to-one conversations. Users can call `ChatManager#pinMessage` or `ChatManager#unpinMessage` to pin or unpin a one-to-one chat message.
- Optimized the connections to the server under weak network conditions for native platforms.

#### Issues fixed

The following issues are fixed on native platforms:
- An attachment message can still be sent successfully despite of failure of sending the attachment under special circumstances.
- An incorrect nextkey is returned when pulling roaming messages.
- The cache is not updated upon the addition of contacts to block list.
- The official push feature may not work after users log out and log in again.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## v1.3.1

v1.3.1 was released on XXXX, 2024.

#### Improvements

- Added the support for pinning messages in one-to-one conversations. Users can call `AgoraChatManager#pinMessage` or `AgoraChatManager#unpinMessage` to pin or unpin a one-to-one chat message.

#### Issues fixed

- A crash occurs when `conversationId` is empty during message sending.
- An incorrect nextkey is returned when pulling roaming messages.
- The number of unread messages is inconsistent among multiple devices in certain scenarios.
- The specified image thumbnail size does not take effect during message sending.


Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## v1.3.1

v1.3.1 was released on XXXX, 2024.

#### Improvements

- Added the support for pinning messages in one-to-one conversations. Users can call `ChatManager#pinMessage` or `ChatManager#unpinMessage` to pin or unpin a one-to-one chat message.
- Optimized the connections to the server under weak network conditions for native platforms.

#### Issues fixed

1. The following issues are fixed on native platforms:

- An attachment message can still be sent successfully despite of failure of sending the attachment under special circumstances.
- An incorrect nextkey is returned when pulling roaming messages.
- The cache is not updated upon the addition of contacts to block list.
- The official push feature may not work after users log out and log in again.

2. The following issues are fixed for the React Native Chat SDK:

- The error that `CMakeLists.txt` could not be found is reported during compilation on the Android platform.
- The data conversion issue on the Android platform.


Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## v1.3.1

v1.3.1 was released on XXXX, 2024.

#### Improvements

- Added the support for pinning messages in one-to-one conversations. Users can call `pinMessage` or `unpinMessage` to pin or unpin a one-to-one chat message.
- Added the `ConnectionParameters#isFixedDeviceId` parameter (`true` by default) to specify whether to use a fixed device ID. Specifically, the SDK generates a device ID for a browser and saves it to the local storage. Then in the browser, all SDK instances use the same device. The setting of this parameter affects the strategy of forced logout in multi-device login scenarios. For details, see [Log in from multiple devices](https://docs.agora.io/en/agora-chat/develop/multiple-device-login?platform=web).
In previous versions, a random device ID is used for connections of each SDK instance. In this case, each SDK instance uses a different device for connections.
- Added the callback for DNS request failures.
- Added the reason for requesting to join the group to the `requestToJoin` event that is received by the group owner and administrators that approved the join request.





4 changes: 2 additions & 2 deletions markdown/agora-chat/REST/agora_chat_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| 应用场景 | Token 权限 | Token 构成 | Token 最长有效期 |
| :------------ | :----- | :----------------------------------------- | :------- |
| RESTful API 调用 | App 权限 | <ul><li>你的即时通讯 IM 项目的 App ID。</li><li>你的即时通讯 IM 项目的 App 证书。</li><li>你设置的即时通讯 Token 的有效期。</li></ul> | 24 小时(以 UTC 时区为准) |
| SDK API 调用 | 用户权限 | <ul><li>你的即时通讯 IM 项目的 App ID。</li><li>你的即时通讯 IM 项目的 App 证书。</li><li> 你的即时通讯 IM 项目的 Token 有效期。</li><li>待鉴权用户的 UUID。</li></ul><div class="alert info">UUID 是通过[用户注册 RESTful API](./agora_chat_restful_registration#注册单个用户) 为每个用户所生成的唯一内部标识。</a>.</div> | 24 小时(以 UTC 时区为准) |
| SDK API 调用 | 用户权限 | <ul><li>你的即时通讯 IM 项目的 App ID。</li><li>你的即时通讯 IM 项目的 App 证书。</li><li> 你的即时通讯 IM 项目的 Token 有效期。</li><li>待鉴权用户的 ID。</li> | 24 小时(以 UTC 时区为准) |

## 体验 Token 生成

Expand Down Expand Up @@ -480,7 +480,7 @@ return builder.buildUserToken(appid, appcert, chatUserId, expirePeriod);

在下列示例代码中可以看到,就客户端而言,用户权限 Token 和以下代码逻辑有关:

- 调用 `open`,使用 Token 和用户名登录即时通讯 IM 系统。需使用注册时所输入的用户名获得 UUID。
- 调用 `open`,使用 Token 和用户名登录即时通讯 IM 系统。
- 当 Token 即将过期或已经过期时,从 App Server 重新获取新的 Token 并调用 `renewToken` 更新 Token。即时通讯 IM 建议你定期(例如每小时)生成一个 Token 并调用 `renewToken` 更新 Token,确保 Token 的有效性。

```js
Expand Down

0 comments on commit c9f625c

Please sign in to comment.