Skip to content

Commit 06cbc23

Browse files
feat: update the documentation for the react native sdk v3.8.3-patch.10.2 (#285)
* feat: update React Native SDK quickstart for v3.8.3-patch.10.2 * feat: add React Native SDK OpenIMApiError definitions * feat(rn-sdk): document OpenIMApiError; make operationID optional; update API params - Replace CatchResponse with OpenIMApiError (name, code, message, operationID) - Mark operationID as optional across RN SDK docs - Update params for getFriendApplicationListAsApplicant/Recipient and getGroupApplicationListAsApplicant/Recipient * feat(rn-sdk): add logFilePath parameter to InitConfig * feat(rn-sdk): update code examples and function prototype * feat(rn-sdk): update getAdvancedHistoryMessageList and getAdvancedHistoryMessageListReverse
1 parent d86a23e commit 06cbc23

File tree

108 files changed

+906
-798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+906
-798
lines changed

docs/sdks/api/conversation/changeInputStates.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ IMSDK.asyncApi('changeInputStates', IMSDK.uuid(), {
249249
### 函数原型
250250

251251
```ts showLineNumbers
252-
OpenIMSDKRN.changeInputStates({
252+
OpenIMSDK.changeInputStates({
253253
conversationID: string,
254254
focus: boolean,
255-
}, operationID: string): Promise<void>
255+
}, operationID?: string): Promise<void>
256256
```
257257

258258
### 输入参数
@@ -261,27 +261,27 @@ OpenIMSDKRN.changeInputStates({
261261
| -------------- | -------- | -------- | ------- |
262262
| conversationID | string || 会话 ID |
263263
| focus | boolean || 是否正在输入 |
264-
| operationID | string | | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
264+
| operationID | string | | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
265265

266266
### 返回结果
267267
| 参数名称 | 参数类型 | 描述 |
268268
| --------------- | ------------------------------------------------------- | ------------ |
269269
| Promise.then() | Promise<void\> | 调用成功回调 |
270-
| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 |
270+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
271271

272272
### 代码示例
273273

274274
```js showLineNumbers
275-
import OpenIMSDKRN from "open-im-sdk-rn";
275+
import OpenIMSDK from "@openim/rn-client-sdk";
276276

277-
OpenIMSDKRN.changeInputStates({
277+
OpenIMSDK.changeInputStates({
278278
conversationID: 'conversationID',
279279
focus: true,
280-
}, 'operationID')
280+
})
281281
.then(() => {
282282
// 调用成功
283283
})
284-
.catch(({ errCode, errMsg }) => {
284+
.catch((error) => {
285285
// 调用失败
286286
});
287287
```

docs/sdks/api/conversation/clearConversationAndDeleteAllMsg.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,32 +229,32 @@ IMSDK.asyncApi(
229229
### 函数原型
230230

231231
```ts showLineNumbers
232-
OpenIMSDKRN.clearConversationAndDeleteAllMsg(operationID: string, conversationID: string): Promise<void>
232+
OpenIMSDK.clearConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise<void>
233233
```
234234

235235
### 输入参数
236236

237237
| 参数名称 | 参数类型 | 是否必填 | 描述 |
238238
| -------------- | -------- | -------- | ------------------------------------------------------- |
239-
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
240239
| conversationID | string || 会话 ID |
240+
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
241241

242242
### 返回结果
243243
| 参数名称 | 参数类型 | 描述 |
244244
| --------------- | ------------------------------------------------------- | ------------ |
245245
| Promise.then() | Promise<void\> | 调用成功回调 |
246-
| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 |
246+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
247247

248248
### 代码示例
249249

250250
```js showLineNumbers
251-
import OpenIMSDKRN from "open-im-sdk-rn";
251+
import OpenIMSDK from "@openim/rn-client-sdk";
252252

253-
OpenIMSDKRN.clearConversationAndDeleteAllMsg("conversationID", 'operationID')
253+
OpenIMSDK.clearConversationAndDeleteAllMsg("conversationID")
254254
.then(() => {
255255
// 调用成功
256256
})
257-
.catch(({ errCode, errMsg }) => {
257+
.catch((error) => {
258258
// 调用失败
259259
});
260260
```

docs/sdks/api/conversation/deleteConversationAndDeleteAllMsg.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,32 +223,32 @@ IMSDK.asyncApi(
223223
### 函数原型
224224

225225
```ts showLineNumbers
226-
OpenIMSDKRN.deleteConversationAndDeleteAllMsg(operationID: string, conversationID: string): Promise<void>
226+
OpenIMSDK.deleteConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise<void>
227227
```
228228

229229
### 输入参数
230230

231231
| 参数名称 | 参数类型 | 是否必填 | 描述 |
232232
| -------------- | -------- | -------- | ------------------------------------------------------- |
233-
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
234233
| conversationID | string || 会话 ID |
234+
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
235235

236236
### 返回结果
237237
| 参数名称 | 参数类型 | 描述 |
238238
| --------------- | ------------------------------------------------------- | ------------ |
239239
| Promise.then() | Promise<void\> | 调用成功回调 |
240-
| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 |
240+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
241241

242242
### 代码示例
243243

244244
```js showLineNumbers
245-
import OpenIMSDKRN from "open-im-sdk-rn";
245+
import OpenIMSDK from "@openim/rn-client-sdk";
246246

247-
OpenIMSDKRN.deleteConversationAndDeleteAllMsg("conversationID", 'operationID')
247+
OpenIMSDK.deleteConversationAndDeleteAllMsg("conversationID")
248248
.then(() => {
249249
// 调用成功
250250
})
251-
.catch(({ errCode, errMsg }) => {
251+
.catch((error) => {
252252
// 调用失败
253253
});
254254
```

docs/sdks/api/conversation/getAllConversationList.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,32 +218,32 @@ IMSDK.asyncApi('getAllConversationList', IMSDK.uuid())
218218
### 函数原型
219219

220220
```ts showLineNumbers
221-
OpenIMSDKRN.getAllConversationList(operationID: string): Promise<ConversationItem[]>
221+
OpenIMSDK.getAllConversationList(operationID?: string): Promise<ConversationItem[]>
222222
```
223223

224224
### 输入参数
225225

226226
| 参数名称 | 参数类型 | 是否必填 | 描述 |
227227
| ----------- | -------- | -------- | ------------------------------------------------------- |
228-
| operationID | string | | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
228+
| operationID | string | | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
229229

230230
### 返回结果
231231

232232
| 参数名称 | 参数类型 | 描述 |
233233
| --------------- | --------------------------------------------------------------------------------------------- | ------------ |
234234
| Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)[]>\> | 调用成功回调 |
235-
| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 |
235+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
236236

237237
### 代码示例
238238

239239
```js showLineNumbers
240-
import OpenIMSDKRN from "open-im-sdk-rn";
240+
import OpenIMSDK from "@openim/rn-client-sdk";
241241

242-
OpenIMSDKRN.getAllConversationList('operationID')
242+
OpenIMSDK.getAllConversationList()
243243
.then((data) => {
244244
// 调用成功
245245
})
246-
.catch(({ errCode, errMsg }) => {
246+
.catch((error) => {
247247
// 调用失败
248248
});
249249
```

docs/sdks/api/conversation/getConversationIDBySessionType.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,41 +227,41 @@ IMSDK.asyncApi('getConversationIDBySessionType', IMSDK.uuid(), {
227227
### 函数原型
228228

229229
```ts showLineNumbers
230-
OpenIMSDKRN.getConversationIDBySessionType({
230+
OpenIMSDK.getConversationIDBySessionType({
231231
sourceID: string,
232232
sessionType: number,
233-
}, operationID: string): Promise<string>
233+
}, operationID?: string): Promise<string>
234234
```
235235

236236
### 输入参数
237237

238238
| 参数名称 | 参数类型 | 是否必填 | 描述 |
239239
| ----------- | -------------------------------------------------- | -------- | ------------------------------------------------------- |
240-
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
241240
| sourceID | string || 会话的用户 ID(单聊)或 groupID(群聊) |
242241
| sessionType | [SessionType](docs/sdks/enum/conversationType.mdx) || 会话类型 |
242+
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
243243

244244

245245
### 返回结果
246246

247247
| 参数名称 | 参数类型 | 描述 |
248248
| --------------- | ------------------------------------------------------- | ------------ |
249249
| Promise.then() | Promise<string\> | 调用成功回调 |
250-
| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 |
250+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
251251

252252
### 代码示例
253253

254254
```js showLineNumbers
255-
import OpenIMSDKRN from "open-im-sdk-rn";
255+
import OpenIMSDK from "@openim/rn-client-sdk";
256256

257-
OpenIMSDKRN.getConversationIDBySessionType({
257+
OpenIMSDK.getConversationIDBySessionType({
258258
sourceID: 'user1',
259259
sessionType: 1,
260-
}, 'operationID')
260+
}
261261
.then((data) => {
262262
// 调用成功
263263
})
264-
.catch(({ errCode, errMsg }) => {
264+
.catch((error) => {
265265
// 调用失败
266266
});
267267
```

docs/sdks/api/conversation/getConversationListSplit.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,41 +245,41 @@ IMSDK.asyncApi('getConversationListSplit', IMSDK.uuid(), {
245245
### 函数原型
246246

247247
```ts showLineNumbers
248-
OpenIMSDKRN.getConversationListSplit({
248+
OpenIMSDK.getConversationListSplit({
249249
offset: number,
250250
count: number,
251-
}, operationID: string): Promise<ConversationItem[]>
251+
}, operationID?: string): Promise<ConversationItem[]>
252252
```
253253

254254
### 输入参数
255255

256256
| 参数名称 | 参数类型 | 是否必填 | 描述 |
257257
| ----------- | -------- | -------- | ------------------------------------------------------- |
258-
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
259258
| offset | number || 分页拉取起始下标 |
260259
| count | number || 一页拉取的数量 |
260+
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
261261

262262

263263
### 返回结果
264264

265265
| 参数名称 | 参数类型 | 描述 |
266266
| --------------- | -------------------------------------------------------------------------------- | ------------ |
267267
| Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)[]> | 调用成功回调 |
268-
| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 |
268+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
269269

270270
### 代码示例
271271

272272
```js showLineNumbers
273-
import OpenIMSDKRN from "open-im-sdk-rn";
273+
import OpenIMSDK from "@openim/rn-client-sdk";
274274

275-
OpenIMSDKRN.getConversationListSplit({
275+
OpenIMSDK.getConversationListSplit({
276276
offset: 0,
277277
count: 20,
278-
}, 'operationID')
278+
})
279279
.then((data) => {
280280
// 调用成功
281281
})
282-
.catch(({ errCode, errMsg }) => {
282+
.catch((error) => {
283283
// 调用失败
284284
});
285285
```

docs/sdks/api/conversation/getInputStates.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ IMSDK.asyncApi('getInputstates', IMSDK.uuid(), {
247247
### 函数原型
248248

249249
```ts showLineNumbers
250-
OpenIMSDKRN.getInputstates({
250+
OpenIMSDK.getInputstates({
251251
conversationID: string,
252252
userID: string,
253-
}, operationID: string): Promise<number[]>
253+
}, operationID?: string): Promise<number[]>
254254
```
255255

256256
### 输入参数
@@ -259,27 +259,27 @@ OpenIMSDKRN.getInputstates({
259259
| -------------- | -------- | -------- | ------- |
260260
| conversationID | string || 会话 ID |
261261
| userID | string || 用户ID |
262-
| operationID | string | | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
262+
| operationID | string | | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
263263

264264
### 返回结果
265265
| 参数名称 | 参数类型 | 描述 |
266266
| --------------- | ------------------------------------------------------- | ------------ |
267267
| Promise.then() | Promise<number[]\> | 调用成功回调 |
268-
| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 |
268+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
269269

270270
### 代码示例
271271

272272
```js showLineNumbers
273-
import OpenIMSDKRN from "open-im-sdk-rn";
273+
import OpenIMSDK from "@openim/rn-client-sdk";
274274

275-
OpenIMSDKRN.getInputstates({
275+
OpenIMSDK.getInputstates({
276276
conversationID: 'conversationID',
277277
userID: 'userID',
278-
}, 'operationID')
278+
})
279279
.then(() => {
280280
// 调用成功
281281
})
282-
.catch(({ errCode, errMsg }) => {
282+
.catch((error) => {
283283
// 调用失败
284284
});
285285
```

docs/sdks/api/conversation/getMultipleConversation.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,36 +218,35 @@ IMSDK.asyncApi('getMultipleConversation', IMSDK.uuid(), ['conversationID'])
218218
### 函数原型
219219

220220
```ts showLineNumbers
221-
OpenIMSDKRN.getMultipleConversation({
221+
OpenIMSDK.getMultipleConversation({
222222
conversationIDList: string[],
223-
}, operationID: string): Promise<ConversationItem[]>
223+
}, operationID?: string): Promise<ConversationItem[]>
224224
```
225225

226226
### 输入参数
227227

228228
| 参数名称 | 参数类型 | 是否必填 | 描述 |
229229
| ------------------ | -------- | -------- | ------------------------------------------------------- |
230-
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
231230
| conversationIDList | string[] || 会话 ID 列表 |
232-
231+
| operationID | string || 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 |
233232

234233
### 返回结果
235234

236235
| 参数名称 | 参数类型 | 描述 |
237236
| --------------- | -------------------------------------------------------------------------------- | ------------ |
238237
| Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)[]> | 调用成功回调 |
239-
| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 |
238+
| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 |
240239

241240
### 代码示例
242241

243242
```js showLineNumbers
244-
import OpenIMSDKRN from "open-im-sdk-rn";
243+
import OpenIMSDK from "@openim/rn-client-sdk";
245244

246-
OpenIMSDKRN.getMultipleConversation(['conversationID'], 'operationID')
245+
OpenIMSDK.getMultipleConversation(['conversationID'])
247246
.then((data) => {
248247
// 调用成功
249248
})
250-
.catch(({ errCode, errMsg }) => {
249+
.catch((error) => {
251250
// 调用失败
252251
});
253252
```

0 commit comments

Comments
 (0)