Skip to content

Commit 878b0fd

Browse files
authored
Merge pull request #1193 from haoxiuwen/doc-v2
Add HarmonyOS 1.5.3 Release Notes
2 parents b13e132 + b5782ed commit 878b0fd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/document/harmonyos/releasenote.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
<Toc />
44

5+
## 版本 V1.5.3 Dev 2025-3-17(开发版)
6+
7+
### 新增特性
8+
9+
- 新增 [ContactManager#getContact](user_relationship.html#从本地获取好友列表) 方法,用于获取本地单个联系人的信息。
10+
11+
### 优化
12+
13+
- `PushListener#onError` 回调,增加回调 SDK 内部调用系统库 PushKit 获取 push token 失败的信息。
14+
- 底层长连接使用 poll 代替 select,解决文件描述符(fd)最大数量 1024 的限制问题。
15+
516
## 版本 V1.5.2 Dev 2025-3-10(开发版)
617

718
### 新增特性

docs/document/harmonyos/user_relationship.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,25 @@ ChatClient.getInstance().contactManager()?.fetchAllContactsIDFromServer().then(r
158158

159159
你可以调用 `getContactsFromLocal` 方法一次性获取整个好友列表,其中每个好友对象包含好友的用户 ID 和好友备注。
160160

161+
自 1.5.3 版本开始,你可以调用 `getContact` 方法从本地获取单个好友的用户 ID 和好友备注。
162+
161163
:::tip
162164
需要从服务器获取好友列表之后,才能从本地获取到好友列表。
163165
:::
164166

167+
- 本地获取单个好友。
168+
169+
```typescript
170+
ChatClient.getInstance().contactManager()?.getContact(this.contactId).then((contact) => {
171+
if (contact) {
172+
let remark = contact.remark();
173+
let username = contact.userId();
174+
}
175+
}).catch((e: ChatError) => {
176+
// failure logic
177+
});
178+
```
179+
165180
- 一次性获取本地好友列表。
166181

167182
```typescript

0 commit comments

Comments
 (0)