diff --git a/docs/sdks/api/conversation/changeInputStates.mdx b/docs/sdks/api/conversation/changeInputStates.mdx index ec7137257f..7a1bbf590c 100644 --- a/docs/sdks/api/conversation/changeInputStates.mdx +++ b/docs/sdks/api/conversation/changeInputStates.mdx @@ -249,10 +249,10 @@ IMSDK.asyncApi('changeInputStates', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.changeInputStates({ +OpenIMSDK.changeInputStates({ conversationID: string, focus: boolean, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -261,27 +261,27 @@ OpenIMSDKRN.changeInputStates({ | -------------- | -------- | -------- | ------- | | conversationID | string | 是 | 会话 ID | | focus | boolean | 是 | 是否正在输入 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.changeInputStates({ +OpenIMSDK.changeInputStates({ conversationID: 'conversationID', focus: true, -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/clearConversationAndDeleteAllMsg.mdx b/docs/sdks/api/conversation/clearConversationAndDeleteAllMsg.mdx index 5c7be52615..e51286fc43 100644 --- a/docs/sdks/api/conversation/clearConversationAndDeleteAllMsg.mdx +++ b/docs/sdks/api/conversation/clearConversationAndDeleteAllMsg.mdx @@ -229,32 +229,32 @@ IMSDK.asyncApi( ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.clearConversationAndDeleteAllMsg(operationID: string, conversationID: string): Promise +OpenIMSDK.clearConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 是 | 会话 ID | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.clearConversationAndDeleteAllMsg("conversationID", 'operationID') +OpenIMSDK.clearConversationAndDeleteAllMsg("conversationID") .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/deleteConversationAndDeleteAllMsg.mdx b/docs/sdks/api/conversation/deleteConversationAndDeleteAllMsg.mdx index 9d74dfb2fc..86aad49f16 100644 --- a/docs/sdks/api/conversation/deleteConversationAndDeleteAllMsg.mdx +++ b/docs/sdks/api/conversation/deleteConversationAndDeleteAllMsg.mdx @@ -223,32 +223,32 @@ IMSDK.asyncApi( ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.deleteConversationAndDeleteAllMsg(operationID: string, conversationID: string): Promise +OpenIMSDK.deleteConversationAndDeleteAllMsg(conversationID: string, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 是 | 会话 ID | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.deleteConversationAndDeleteAllMsg("conversationID", 'operationID') +OpenIMSDK.deleteConversationAndDeleteAllMsg("conversationID") .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getAllConversationList.mdx b/docs/sdks/api/conversation/getAllConversationList.mdx index c4d48ad22d..2afb4b2946 100644 --- a/docs/sdks/api/conversation/getAllConversationList.mdx +++ b/docs/sdks/api/conversation/getAllConversationList.mdx @@ -218,32 +218,32 @@ IMSDK.asyncApi('getAllConversationList', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getAllConversationList(operationID: string): Promise +OpenIMSDK.getAllConversationList(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | --------------------------------------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)[]>\> | 调用成功回调 | -| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getAllConversationList('operationID') +OpenIMSDK.getAllConversationList() .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getConversationIDBySessionType.mdx b/docs/sdks/api/conversation/getConversationIDBySessionType.mdx index 8f14161d67..5d1e9e0e20 100644 --- a/docs/sdks/api/conversation/getConversationIDBySessionType.mdx +++ b/docs/sdks/api/conversation/getConversationIDBySessionType.mdx @@ -227,19 +227,19 @@ IMSDK.asyncApi('getConversationIDBySessionType', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getConversationIDBySessionType({ +OpenIMSDK.getConversationIDBySessionType({ sourceID: string, sessionType: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------------------------------------------------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | sourceID | string | 是 | 会话的用户 ID(单聊)或 groupID(群聊) | | sessionType | [SessionType](docs/sdks/enum/conversationType.mdx) | 是 | 会话类型 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -247,21 +247,21 @@ OpenIMSDKRN.getConversationIDBySessionType({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getConversationIDBySessionType({ +OpenIMSDK.getConversationIDBySessionType({ sourceID: 'user1', sessionType: 1, -}, 'operationID') +} .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getConversationListSplit.mdx b/docs/sdks/api/conversation/getConversationListSplit.mdx index 958e39ae2c..eade3cab33 100644 --- a/docs/sdks/api/conversation/getConversationListSplit.mdx +++ b/docs/sdks/api/conversation/getConversationListSplit.mdx @@ -245,19 +245,19 @@ IMSDK.asyncApi('getConversationListSplit', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getConversationListSplit({ +OpenIMSDK.getConversationListSplit({ offset: number, count: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | offset | number | 是 | 分页拉取起始下标 | | count | number | 是 | 一页拉取的数量 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -265,21 +265,21 @@ OpenIMSDKRN.getConversationListSplit({ | 参数名称 | 参数类型 | 描述 | | --------------- | -------------------------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)[]> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getConversationListSplit({ +OpenIMSDK.getConversationListSplit({ offset: 0, count: 20, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getInputStates.mdx b/docs/sdks/api/conversation/getInputStates.mdx index 66d2369fea..02926c06d0 100644 --- a/docs/sdks/api/conversation/getInputStates.mdx +++ b/docs/sdks/api/conversation/getInputStates.mdx @@ -247,10 +247,10 @@ IMSDK.asyncApi('getInputstates', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getInputstates({ +OpenIMSDK.getInputstates({ conversationID: string, userID: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -259,27 +259,27 @@ OpenIMSDKRN.getInputstates({ | -------------- | -------- | -------- | ------- | | conversationID | string | 是 | 会话 ID | | userID | string | 是 | 用户ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[Response](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getInputstates({ +OpenIMSDK.getInputstates({ conversationID: 'conversationID', userID: 'userID', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getMultipleConversation.mdx b/docs/sdks/api/conversation/getMultipleConversation.mdx index de3c826532..0f31db4a50 100644 --- a/docs/sdks/api/conversation/getMultipleConversation.mdx +++ b/docs/sdks/api/conversation/getMultipleConversation.mdx @@ -218,36 +218,35 @@ IMSDK.asyncApi('getMultipleConversation', IMSDK.uuid(), ['conversationID']) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getMultipleConversation({ +OpenIMSDK.getMultipleConversation({ conversationIDList: string[], -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ------------------ | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationIDList | string[] | 是 | 会话 ID 列表 | - +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | -------------------------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)[]> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getMultipleConversation(['conversationID'], 'operationID') +OpenIMSDK.getMultipleConversation(['conversationID']) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getOneConversation.mdx b/docs/sdks/api/conversation/getOneConversation.mdx index b0d8831500..1b37f84660 100644 --- a/docs/sdks/api/conversation/getOneConversation.mdx +++ b/docs/sdks/api/conversation/getOneConversation.mdx @@ -240,41 +240,40 @@ IMSDK.asyncApi('getOneConversation', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getOneConversation({ +OpenIMSDK.getOneConversation({ sessionType: number, sourceID: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------------------------------------------------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | sourceID | string | 是 | 会话的用户 ID(单聊)或 groupID(群聊) | | sessionType | [SessionType](docs/sdks/enum/conversationType.mdx) | 是 | 会话类型 | - +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[ConversationItem](docs/sdks/class/conversation/conversationInfo.mdx)> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; - OpenIMSDKRN.getOneConversation({ + OpenIMSDK.getOneConversation({ sourceID: 'user1', sessionType: 1, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/getTotalUnreadMsgCount.mdx b/docs/sdks/api/conversation/getTotalUnreadMsgCount.mdx index fdb8dffbb4..14939cca6f 100644 --- a/docs/sdks/api/conversation/getTotalUnreadMsgCount.mdx +++ b/docs/sdks/api/conversation/getTotalUnreadMsgCount.mdx @@ -211,32 +211,32 @@ IMSDK.asyncApi('getTotalUnreadMsgCount', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getTotalUnreadMsgCount(operationID: string): Promise +OpenIMSDK.getTotalUnreadMsgCount(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getTotalUnreadMsgCount('operationID') +OpenIMSDK.getTotalUnreadMsgCount() .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/hideAllConversation.mdx b/docs/sdks/api/conversation/hideAllConversation.mdx index d14b1e0ca8..08aff487b5 100644 --- a/docs/sdks/api/conversation/hideAllConversation.mdx +++ b/docs/sdks/api/conversation/hideAllConversation.mdx @@ -171,14 +171,14 @@ IMSDK.deleteAllConversationFromLocal() ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.hideAllConversations(operationID: string): Promise +OpenIMSDK.hideAllConversations(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -190,13 +190,13 @@ OpenIMSDKRN.hideAllConversations(operationID: string): Promise ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.hideAllConversations('operationID') +OpenIMSDK.hideAllConversations() .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/hideConversation.mdx b/docs/sdks/api/conversation/hideConversation.mdx index a8756ab2b5..528e1f543d 100644 --- a/docs/sdks/api/conversation/hideConversation.mdx +++ b/docs/sdks/api/conversation/hideConversation.mdx @@ -218,7 +218,7 @@ IMSDK.asyncApi('hideConversation', IMSDK.uuid(), 'conversationID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.hideConversation(conversationID: string, operationID: string): Promise +OpenIMSDK.hideConversation(conversationID: string, operationID?: string): Promise ``` ### 输入参数 @@ -226,25 +226,25 @@ OpenIMSDKRN.hideConversation(conversationID: string, operationID: string): Promi | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | | conversationID | string | 是 | 会话 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------- | ------------ | -| Promise.then() | Promise<[WsResponse](docs/sdks/class/response.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[WsResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.then() | Promise<[void](docs/sdks/class/response.mdx)\> | 调用成功回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.hideConversation('conversationID', 'operationID') +OpenIMSDK.hideConversation('conversationID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/markConversationMessageAsRead.mdx b/docs/sdks/api/conversation/markConversationMessageAsRead.mdx index d063dd6576..e42e5be1f9 100644 --- a/docs/sdks/api/conversation/markConversationMessageAsRead.mdx +++ b/docs/sdks/api/conversation/markConversationMessageAsRead.mdx @@ -233,33 +233,33 @@ IMSDK.asyncApi('markConversationMessageAsRead', IMSDK.uuid(), 'conversationID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.markConversationMessageAsRead(operationID: string, conversationID: string): Promise +OpenIMSDK.markConversationMessageAsRead(conversationID: string, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 是 | 会话 ID | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.markConversationMessageAsRead('conversationID', 'operationID') +OpenIMSDK.markConversationMessageAsRead('conversationID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/setConversation.mdx b/docs/sdks/api/conversation/setConversation.mdx index f67171f217..c02523aa85 100644 --- a/docs/sdks/api/conversation/setConversation.mdx +++ b/docs/sdks/api/conversation/setConversation.mdx @@ -268,7 +268,7 @@ IMSDK.asyncApi('setConversation', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setConversation({ +OpenIMSDK.setConversation({ conversationID: string; recvMsgOpt?: MessageReceiveOptType; groupAtType?: GroupAtType; @@ -276,7 +276,7 @@ OpenIMSDKRN.setConversation({ isPinned?: boolean; isPrivateChat?: boolean; ex?: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -296,24 +296,23 @@ OpenIMSDKRN.setConversation({ | 参数名称 | 参数类型 | 描述 | | --------------- | -------------------------------------------------------- | ------------ | | Promise.then() | Promise\ | 调用成功回调 | -| Promise.catch() | Promise\<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise\<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.setConversation( +OpenIMSDK.setConversation( { conversationID: '', isPinned: true, - }, - 'operationID' + } ) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/conversation/setConversationDraft.mdx b/docs/sdks/api/conversation/setConversationDraft.mdx index 9bef371b67..8c681a9341 100644 --- a/docs/sdks/api/conversation/setConversationDraft.mdx +++ b/docs/sdks/api/conversation/setConversationDraft.mdx @@ -247,10 +247,10 @@ IMSDK.asyncApi('setConversationDraft', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setConversationDraft({ +OpenIMSDK.setConversationDraft({ conversationID: string, draftText: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -259,28 +259,28 @@ OpenIMSDKRN.setConversationDraft({ | -------------- | -------- | -------- | ------------------------------------------------------- | | conversationID | string | 是 | 会话 ID | | draftText | string | 是 | 草稿内容 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise\ | 调用成功回调 | -| Promise.catch() | Promise\<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise\<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.setConversationDraft({ +OpenIMSDK.setConversationDraft({ conversationID: '', draftText: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/acceptGroupApplication.mdx b/docs/sdks/api/group/acceptGroupApplication.mdx index 81d8c26ac1..8358f46b1e 100644 --- a/docs/sdks/api/group/acceptGroupApplication.mdx +++ b/docs/sdks/api/group/acceptGroupApplication.mdx @@ -272,11 +272,11 @@ IMSDK.asyncApi('acceptGroupApplication', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.acceptGroupApplication({ +OpenIMSDK.acceptGroupApplication({ groupID: string, fromUserID: string, handleMsg: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -286,29 +286,29 @@ OpenIMSDKRN.acceptGroupApplication({ | groupID | string | 是 | 群ID | | fromUserID | string | 是 | 申请发起者用户 ID | | handleMsg | string | 是 | 操作信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.acceptGroupApplication({ +OpenIMSDK.acceptGroupApplication({ groupID: '', fromUserID: '', handleMsg: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/changeGroupMemberMute.mdx b/docs/sdks/api/group/changeGroupMemberMute.mdx index d5fe1b0e46..103b3dd681 100644 --- a/docs/sdks/api/group/changeGroupMemberMute.mdx +++ b/docs/sdks/api/group/changeGroupMemberMute.mdx @@ -273,11 +273,11 @@ IMSDK.asyncApi('changeGroupMemberMute', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.changeGroupMemberMute({ +OpenIMSDK.changeGroupMemberMute({ groupID: string, userID: string, mutedSeconds: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -287,30 +287,30 @@ OpenIMSDKRN.changeGroupMemberMute({ | groupID | string | 是 | 群ID | | userID | string | 是 | 要操作的群成员用户 ID | | mutedSeconds | number | 是 | 要禁言的时长,单位秒。为 0 时取消禁言 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.changeGroupMemberMute({ +OpenIMSDK.changeGroupMemberMute({ groupID: '', userID: '', mutedSeconds: 7200, -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/changeGroupMute.mdx b/docs/sdks/api/group/changeGroupMute.mdx index 3c5fa2e9c5..fc77a9d57f 100644 --- a/docs/sdks/api/group/changeGroupMute.mdx +++ b/docs/sdks/api/group/changeGroupMute.mdx @@ -259,10 +259,10 @@ IMSDK.asyncApi('changeGroupMute', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.changeGroupMute({ +OpenIMSDK.changeGroupMute({ groupID: string, isMute: boolean, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -271,7 +271,7 @@ OpenIMSDKRN.changeGroupMute({ | ----------- | -------- | -------- | ------------------------------------------------------- | | groupID | string | 是 | 群ID | | isMute | boolean | 是 | 是否禁言 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -279,21 +279,21 @@ OpenIMSDKRN.changeGroupMute({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.changeGroupMute({ +OpenIMSDK.changeGroupMute({ groupID: '', isMute: true, -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/createGroup.mdx b/docs/sdks/api/group/createGroup.mdx index a2d970cf8b..38346bef22 100644 --- a/docs/sdks/api/group/createGroup.mdx +++ b/docs/sdks/api/group/createGroup.mdx @@ -291,12 +291,12 @@ IMSDK.asyncApi('createGroup', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createGroup({ +OpenIMSDK.createGroup({ groupInfo: Partial, memberUserIDs: string[], adminUserIDs?: string[], ownerUserID?: string -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -307,7 +307,7 @@ OpenIMSDKRN.createGroup({ | memberUserIDs | string[] | 是 | 邀请进入的群成员列表 | | adminUserIDs | string[] | 否 | 邀请进入并设为管理员的列表 | | ownerUserID | string | 否 | 群主 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -315,24 +315,24 @@ OpenIMSDKRN.createGroup({ | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------- | ------------ | | Promise.then() | Promise<[GroupItem](docs/sdks/class/group/groupInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createGroup({ +OpenIMSDK.createGroup({ groupInfo: { groupName: '', groupType: 2, }, memberUserIDs: [''], -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/dismissGroup.mdx b/docs/sdks/api/group/dismissGroup.mdx index 4570f144e0..4b87b711e4 100644 --- a/docs/sdks/api/group/dismissGroup.mdx +++ b/docs/sdks/api/group/dismissGroup.mdx @@ -240,7 +240,7 @@ IMSDK.asyncApi('dismissGroup', IMSDK.uuid(), 'groupID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.dismissGroup(groupID: string, operationID: string): Promise +OpenIMSDK.dismissGroup(groupID: string, operationID?: string): Promise ``` ### 输入参数 @@ -248,25 +248,25 @@ OpenIMSDKRN.dismissGroup(groupID: string, operationID: string): Promise | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | groupID | string | 是 | 群ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.dismissGroup('groupID', 'operationID') +OpenIMSDK.dismissGroup('groupID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getGroupApplicationListAsApplicant.mdx b/docs/sdks/api/group/getGroupApplicationListAsApplicant.mdx index 35bdc41341..f2257c703e 100644 --- a/docs/sdks/api/group/getGroupApplicationListAsApplicant.mdx +++ b/docs/sdks/api/group/getGroupApplicationListAsApplicant.mdx @@ -235,32 +235,46 @@ IMSDK.asyncApi('getGroupApplicationListAsApplicant', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getGroupApplicationListAsApplicant(operationID: string): Promise +OpenIMSDK.getGroupApplicationListAsApplicant(req: { + groupIDs: string[]; + handleResults: number[] + offset: number; + count: number; +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| groupIDs | string[] | 是 | 群组 ID 列表 | +| handleResults | number[] | 是 | - | +| offset | number | 是 | 分页拉取起始下标 | +| count | number | 是 | 一页拉取的数量 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------------------------- | ------------------ | | Promise.then() | Promise<[GroupApplicationItem](docs/sdks/class/group/groupApplicationInfo.mdx)[]\> | 发出的加群请求列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getGroupApplicationListAsApplicant('operationID') +OpenIMSDK.getGroupApplicationListAsApplicant({ + offset: 0, + count: 10, + groupIDs: ['groupID1', 'groupID2'], + handleResults: [], +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getGroupApplicationListAsRecipient.mdx b/docs/sdks/api/group/getGroupApplicationListAsRecipient.mdx index 5501f99cd1..1148776dc0 100644 --- a/docs/sdks/api/group/getGroupApplicationListAsRecipient.mdx +++ b/docs/sdks/api/group/getGroupApplicationListAsRecipient.mdx @@ -236,32 +236,46 @@ IMSDK.asyncApi('getGroupApplicationListAsRecipient', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getGroupApplicationListAsRecipient(operationID: string): Promise +OpenIMSDK.getGroupApplicationListAsRecipient(req: { + groupIDs: string[]; + handleResults: number[] + offset: number; + count: number; +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| groupIDs | string[] | 是 | 群组 ID 列表 | +| handleResults | number[] | 是 | - | +| offset | number | 是 | 分页拉取起始下标 | +| count | number | 是 | 一页拉取的数量 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------------------------- | ------------------ | | Promise.then() | Promise<[GroupApplicationItem](docs/sdks/class/group/groupApplicationInfo.mdx)[]\> | 发出的加群请求列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getGroupApplicationListAsRecipient('operationID') +OpenIMSDK.getGroupApplicationListAsRecipient({ + offset: 0, + count: 10, + handleResults: [], + groupIDs: ['groupID1', 'groupID2'], +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getGroupMemberList.mdx b/docs/sdks/api/group/getGroupMemberList.mdx index d293508e7d..6899db5aaa 100644 --- a/docs/sdks/api/group/getGroupMemberList.mdx +++ b/docs/sdks/api/group/getGroupMemberList.mdx @@ -283,12 +283,12 @@ IMSDK.asyncApi('getGroupMemberList', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getGroupMemberList({ +OpenIMSDK.getGroupMemberList({ groupID: string, filter: GroupMemberFilter, offset: number, count: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -299,30 +299,30 @@ OpenIMSDKRN.getGroupMemberList({ | filter | [GroupMemberFilter](docs/sdks/enum/groupMemberFilter.mdx) | 是 | 群成员角色 | | offset | number | 是 | 起始偏移,分页拉取使用 | | count | number | 是 | 分页拉取,一页拉取的成员个数 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[GroupMemberItem](docs/sdks/class/group/groupMemberInfo.mdx)[]\> | 群成员列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getGroupMemberList({ +OpenIMSDK.getGroupMemberList({ groupID: '', filter: 0, offset: 0, count: 20, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getGroupMemberListByJoinTimeFilter.mdx b/docs/sdks/api/group/getGroupMemberListByJoinTimeFilter.mdx index 308eb8329f..72a0fa2ca4 100644 --- a/docs/sdks/api/group/getGroupMemberListByJoinTimeFilter.mdx +++ b/docs/sdks/api/group/getGroupMemberListByJoinTimeFilter.mdx @@ -302,14 +302,14 @@ IMSDK.asyncApi('getGroupMemberListByJoinTimeFilter', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getGroupMemberListByJoinTimeFilter({ +OpenIMSDK.getGroupMemberListByJoinTimeFilter({ groupID: string, offset: number, count: number, joinTimeBegin: number, joinTimeEnd: number, filterUserIDList: string[], -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -322,32 +322,32 @@ OpenIMSDKRN.getGroupMemberListByJoinTimeFilter({ | joinTimeBegin | number | 是 | 最早加入时间,为 0 时不限制 | | joinTimeEnd | number | 是 | 最晚加入时间,为 0 时不限制 | | filterUserIDList | string[] | 是 | 需要排除的群成员 userID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[GroupMemberItem](docs/sdks/class/group/groupMemberInfo.mdx)[]\> | 群成员列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getGroupMemberListByJoinTimeFilter({ +OpenIMSDK.getGroupMemberListByJoinTimeFilter({ groupID: '', offset: 0, count: 20, joinTimeBegin: 0, joinTimeEnd: 0, filterUserIDList: ['userID'], -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getGroupMemberOwnerAndAdmin.mdx b/docs/sdks/api/group/getGroupMemberOwnerAndAdmin.mdx index 6e45720903..583fcb00d5 100644 --- a/docs/sdks/api/group/getGroupMemberOwnerAndAdmin.mdx +++ b/docs/sdks/api/group/getGroupMemberOwnerAndAdmin.mdx @@ -231,7 +231,7 @@ IMSDK.asyncApi('getGroupMemberOwnerAndAdmin', IMSDK.uuid(), 'groupID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getGroupMemberOwnerAndAdmin(groupID: string, operationID: string): Promise +OpenIMSDK.getGroupMemberOwnerAndAdmin(groupID: string, operationID?: string): Promise ``` ### 输入参数 @@ -239,25 +239,25 @@ OpenIMSDKRN.getGroupMemberOwnerAndAdmin(groupID: string, operationID: string): P | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | groupID | string | 是 | 群ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[GroupMemberItem](docs/sdks/class/group/groupMemberInfo.mdx)[]\> | 群成员列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getGroupMemberOwnerAndAdmin('groupID', 'operationID') +OpenIMSDK.getGroupMemberOwnerAndAdmin('groupID') .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getJoinedGroupList.mdx b/docs/sdks/api/group/getJoinedGroupList.mdx index 7eec62b7e4..c91d2b2f2e 100644 --- a/docs/sdks/api/group/getJoinedGroupList.mdx +++ b/docs/sdks/api/group/getJoinedGroupList.mdx @@ -216,32 +216,32 @@ IMSDK.asyncApi('getJoinedGroupList', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getJoinedGroupList(operationID: string): Promise +OpenIMSDK.getJoinedGroupList(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------ | -------------- | | Promise.then() | Promise<[GroupItem](docs/sdks/class/group/groupInfo.mdx)[]\> | 加入的群组列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; - OpenIMSDKRN.getJoinedGroupList('operationID') + OpenIMSDK.getJoinedGroupList() .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getJoinedGroupListPage.mdx b/docs/sdks/api/group/getJoinedGroupListPage.mdx index dc469b7bc0..8c070dc012 100644 --- a/docs/sdks/api/group/getJoinedGroupListPage.mdx +++ b/docs/sdks/api/group/getJoinedGroupListPage.mdx @@ -242,10 +242,10 @@ IMSDK.asyncApi('getJoinedGroupList', IMSDK.uuid(), { offset: 0, count: 1000 }) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getJoinedGroupList({ +OpenIMSDK.getJoinedGroupList({ offset: number; count: number; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -254,28 +254,28 @@ OpenIMSDKRN.getJoinedGroupList({ | -------- | -------- | -------- | ------- | | offset | number | 是 | 分页拉取起始下标 | | count | number | 是 | 一页拉取的数量 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------ | -------------- | | Promise.then() | Promise<[GroupItem](docs/sdks/class/group/groupInfo.mdx)[]\> | 加入的群组列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; - OpenIMSDKRN.getJoinedGroupList({ + OpenIMSDK.getJoinedGroupList({ offset: 0; count: 1000; -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getSpecifiedGroupMembersInfo.mdx b/docs/sdks/api/group/getSpecifiedGroupMembersInfo.mdx index 0a9b0fd739..0fb464962b 100644 --- a/docs/sdks/api/group/getSpecifiedGroupMembersInfo.mdx +++ b/docs/sdks/api/group/getSpecifiedGroupMembersInfo.mdx @@ -257,10 +257,10 @@ IMSDK.asyncApi('getSpecifiedGroupMembersInfo', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getSpecifiedGroupMembersInfo({ +OpenIMSDK.getSpecifiedGroupMembersInfo({ groupID: string, userIDList: string[], -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -269,28 +269,28 @@ OpenIMSDKRN.getSpecifiedGroupMembersInfo({ | ----------- | -------- | -------- | ------------------------------------------------------- | | groupID | string | 是 | 群ID | | userIDList | string[] | 是 | 群成员 ID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[GroupMemberItem](docs/sdks/class/group/groupMemberInfo.mdx)[]\> | 群成员列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getSpecifiedGroupMembersInfo({ +OpenIMSDK.getSpecifiedGroupMembersInfo({ groupID: '', userIDList: ['userID'], -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getSpecifiedGroupsInfo.mdx b/docs/sdks/api/group/getSpecifiedGroupsInfo.mdx index 2ea2249c74..6617dcf531 100644 --- a/docs/sdks/api/group/getSpecifiedGroupsInfo.mdx +++ b/docs/sdks/api/group/getSpecifiedGroupsInfo.mdx @@ -233,14 +233,14 @@ IMSDK.asyncApi('getSpecifiedGroupsInfo', IMSDK.uuid(), groupIDList) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getSpecifiedGroupsInfo(groupIDList: string[], operationID: string): Promise +OpenIMSDK.getSpecifiedGroupsInfo(groupIDList: string[], operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | groupIDList | string[] | 是 | 群组 ID 列表 | ### 返回结果 @@ -248,19 +248,19 @@ OpenIMSDKRN.getSpecifiedGroupsInfo(groupIDList: string[], operationID: string): | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[GroupInfo](docs/sdks/class/group/groupInfo.mdx)[]\> | 群组信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const groupIDList = ['userID1', 'userID2']; -OpenIMSDKRN.getSpecifiedGroupsInfo(groupIDList, 'operationID') +OpenIMSDK.getSpecifiedGroupsInfo(groupIDList) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/getUsersInGroup.mdx b/docs/sdks/api/group/getUsersInGroup.mdx index 97660fdf14..8d20f8174d 100644 --- a/docs/sdks/api/group/getUsersInGroup.mdx +++ b/docs/sdks/api/group/getUsersInGroup.mdx @@ -250,10 +250,10 @@ IMSDK.asyncApi('getUsersInGroup', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getUsersInGroup({ +OpenIMSDK.getUsersInGroup({ groupID: string; userIDList: string[]; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -262,28 +262,28 @@ OpenIMSDKRN.getUsersInGroup({ | -------- | -------- | -------- | ------- | | groupID | string | 是 | 群ID | | userIDList | string[] | 是 | 用户ID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.dismissGroup({ +OpenIMSDK.dismissGroup({ groupID: 'groupID', userIDList: ['userIDList'], -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/inviteUserToGroup.mdx b/docs/sdks/api/group/inviteUserToGroup.mdx index 32598236fc..463ad877cb 100644 --- a/docs/sdks/api/group/inviteUserToGroup.mdx +++ b/docs/sdks/api/group/inviteUserToGroup.mdx @@ -285,11 +285,11 @@ IMSDK.asyncApi('inviteUserToGroup', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.inviteUserToGroup({ +OpenIMSDK.inviteUserToGroup({ groupID: string, reason: string, userIDList: string[], -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -299,29 +299,29 @@ OpenIMSDKRN.inviteUserToGroup({ | groupID | string | 是 | 群ID | | reason | string | 是 | 邀请信息 | | userIDList | string[] | 是 | 被邀请用户 userID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.inviteUserToGroup({ +OpenIMSDK.inviteUserToGroup({ groupID: '', reason: '', userIDList: ['userID'], -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/isJoinGroup.mdx b/docs/sdks/api/group/isJoinGroup.mdx index 1db3942bab..010fbbbbd2 100644 --- a/docs/sdks/api/group/isJoinGroup.mdx +++ b/docs/sdks/api/group/isJoinGroup.mdx @@ -229,7 +229,7 @@ IMSDK.asyncApi('isJoinGroup', IMSDK.uuid(), 'groupID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.isJoinGroup(groupID: string, operationID: string): Promise +OpenIMSDK.isJoinGroup(groupID: string, operationID?: string): Promise ``` ### 输入参数 @@ -237,25 +237,25 @@ OpenIMSDKRN.isJoinGroup(groupID: string, operationID: string): Promise | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | groupID | string | 是 | 群ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.isJoinGroup('groupID', 'operationID') +OpenIMSDK.isJoinGroup('groupID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/joinGroup.mdx b/docs/sdks/api/group/joinGroup.mdx index a7744ab65c..37bad9e368 100644 --- a/docs/sdks/api/group/joinGroup.mdx +++ b/docs/sdks/api/group/joinGroup.mdx @@ -262,11 +262,11 @@ IMSDK.asyncApi('joinGroup', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.joinGroup({ +OpenIMSDK.joinGroup({ groupID: string, reqMsg: string, joinSource: GroupJoinSource.Search, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -276,29 +276,29 @@ OpenIMSDKRN.joinGroup({ | groupID | string | 是 | 群ID | | reqMsg | string | 是 | 入群申请信息 | | joinSource | [GroupJoinSource](docs/sdks/enum/joinSource.mdx) | 是 | 加入途径 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.joinGroup({ +OpenIMSDK.joinGroup({ groupID: '', reqMsg: '', joinSource: GroupJoinSource.Search, -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/kickGroupMember.mdx b/docs/sdks/api/group/kickGroupMember.mdx index c630720bbb..ef7b0406d1 100644 --- a/docs/sdks/api/group/kickGroupMember.mdx +++ b/docs/sdks/api/group/kickGroupMember.mdx @@ -287,11 +287,11 @@ IMSDK.asyncApi('kickGroupMember', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.kickGroupMember({ +OpenIMSDK.kickGroupMember({ groupID: string, reason: string, userIDList: string[], -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -301,29 +301,29 @@ OpenIMSDKRN.kickGroupMember({ | groupID | string | 是 | 群ID | | reason | string | 是 | 踢出原因 | | userIDList | string[] | 是 | 提出用户 ID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.kickGroupMember({ +OpenIMSDK.kickGroupMember({ groupID: '', reason: '', userIDList: ['userID'], -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/quitGroup.mdx b/docs/sdks/api/group/quitGroup.mdx index 3b5837e604..7ebbdd64e4 100644 --- a/docs/sdks/api/group/quitGroup.mdx +++ b/docs/sdks/api/group/quitGroup.mdx @@ -240,32 +240,31 @@ IMSDK.asyncApi('quitGroup', IMSDK.uuid(), 'groupID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.quitGroup(groupID: string, operationID: string): Promise +OpenIMSDK.quitGroup(groupID: string, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | groupID | string | 是 | 群ID | - +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.quitGroup('groupID', 'operationID') +OpenIMSDK.quitGroup('groupID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/refuseGroupApplication.mdx b/docs/sdks/api/group/refuseGroupApplication.mdx index cc4a91bcd3..5fb1e3a4c8 100644 --- a/docs/sdks/api/group/refuseGroupApplication.mdx +++ b/docs/sdks/api/group/refuseGroupApplication.mdx @@ -269,11 +269,11 @@ IMSDK.asyncApi('refuseGroupApplication', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.refuseGroupApplication({ +OpenIMSDK.refuseGroupApplication({ groupID: string, fromUserID: string, handleMsg: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -283,29 +283,29 @@ OpenIMSDKRN.refuseGroupApplication({ | groupID | string | 是 | 群ID | | fromUserID | string | 是 | 申请者 userID | | handleMsg | string | 是 | 拒绝原因 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.refuseGroupApplication({ +OpenIMSDK.refuseGroupApplication({ groupID: '', fromUserID: '', handleMsg: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/searchGroupMembers.mdx b/docs/sdks/api/group/searchGroupMembers.mdx index ac114cbcda..0303fb008c 100644 --- a/docs/sdks/api/group/searchGroupMembers.mdx +++ b/docs/sdks/api/group/searchGroupMembers.mdx @@ -298,14 +298,14 @@ IMSDK.asyncApi('searchGroupMembers', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.searchGroupMembers({ +OpenIMSDK.searchGroupMembers({ groupID: string; keywordList: string[]; isSearchUserID: boolean; isSearchMemberNickname: boolean; offset: number; count: number; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -316,7 +316,7 @@ OpenIMSDKRN.searchGroupMembers({ | isSearchUserID | boolean | 是 | 是否以关键词搜索 userID | | isSearchNickname | boolean | 是 | 是否以关键词搜索昵称 | | isSearchRemark | boolean | 是 | 是否以关键词搜索备注 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | offset | number | 是 | 起始偏移,分页拉取使用 | | count | number | 是 | 分页拉取,一页拉取的成员个数 | @@ -325,25 +325,25 @@ OpenIMSDKRN.searchGroupMembers({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------ | ---------------------- | | Promise.then() | Promise<[GroupMemberItem](docs/sdks/class/group/groupMemberInfo.mdx)[]\> | 搜索到的群成员信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.searchGroupMembers({ +OpenIMSDK.searchGroupMembers({ groupID: '', keywordList: ['nickname'], isSearchUserID: false, isSearchMemberNickname: true, offset: 0, count: 20, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/searchGroups.mdx b/docs/sdks/api/group/searchGroups.mdx index 825cf8fcc1..8b57bbc3d1 100644 --- a/docs/sdks/api/group/searchGroups.mdx +++ b/docs/sdks/api/group/searchGroups.mdx @@ -262,11 +262,11 @@ IMSDK.asyncApi('searchGroups', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.searchGroups({ +OpenIMSDK.searchGroups({ keywordList: string[]; isSearchGroupID: boolean; isSearchGroupName: boolean; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -276,30 +276,30 @@ OpenIMSDKRN.searchGroups({ | keywordList | string[] | 是 | 搜索关键词,目前仅支持一个关键词搜索,不能为空 | | isSearchGroupID | boolean | 是 | 是否以关键词搜索群ID | | isSearchGroupName | boolean | 是 | 是否以关键词搜索群名称 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------ | -------------------- | | Promise.then() | Promise<[GroupItem](docs/sdks/class/group/groupInfo.mdx)[]\> | 搜索到的群信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.searchGroups({ +OpenIMSDK.searchGroups({ keywordList: ['nickname']; isSearchUserID: false, isSearchNickname: true, isSearchRemark: true, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/setGroupInfo.mdx b/docs/sdks/api/group/setGroupInfo.mdx index aef93310de..a5063968c5 100644 --- a/docs/sdks/api/group/setGroupInfo.mdx +++ b/docs/sdks/api/group/setGroupInfo.mdx @@ -275,7 +275,7 @@ IMSDK.asyncApi('setGroupInfo', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setGroupInfo({ +OpenIMSDK.setGroupInfo({ groupID: string; faceURL?: string; groupName?: string; @@ -285,14 +285,14 @@ OpenIMSDKRN.setGroupInfo({ applyMemberFriend?: AllowType; lookMemberInfo?: AllowType; ex?: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | ------------------------------------------------------------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | groupID | string | 是 | 群组 ID | | faceURL | string | 否 | 群头像 | | groupName | string | 否 | 群名称 | @@ -308,24 +308,23 @@ OpenIMSDKRN.setGroupInfo({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; -OpenIMSDKRN.setGroupInfo( +OpenIMSDK.setGroupInfo( { groupID: 'groupID', groupName: 'new name', - }, - 'operationID' + } ) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/setGroupMemberInfo.mdx b/docs/sdks/api/group/setGroupMemberInfo.mdx index 041c5d378a..adc792aa02 100644 --- a/docs/sdks/api/group/setGroupMemberInfo.mdx +++ b/docs/sdks/api/group/setGroupMemberInfo.mdx @@ -259,14 +259,14 @@ IMSDK.asyncApi('setGroupMemberInfo', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setGroupMemberInfo({ +OpenIMSDK.setGroupMemberInfo({ groupID: string; userID: string; nickname?: string; faceURL?: string; roleLevel?: GroupMemberRole; ex?: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -279,29 +279,29 @@ OpenIMSDKRN.setGroupMemberInfo({ | faceURL | string | 否 | 群成员头像URL | | roleLevel | string | 否 | 群成员角色 | | ex | string | 否 | 群成员扩展信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.setGroupMemberInfo({ +OpenIMSDK.setGroupMemberInfo({ groupID: '', userID: '', nickname: 'new name', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/group/transferGroupOwner.mdx b/docs/sdks/api/group/transferGroupOwner.mdx index 1ea0693475..84bc8629f9 100644 --- a/docs/sdks/api/group/transferGroupOwner.mdx +++ b/docs/sdks/api/group/transferGroupOwner.mdx @@ -262,10 +262,10 @@ IMSDK.asyncApi('transferGroupOwner', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.transferGroupOwner({ +OpenIMSDK.transferGroupOwner({ groupID: string, newOwnerUserID: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -274,29 +274,29 @@ OpenIMSDKRN.transferGroupOwner({ | -------------- | -------- | -------- | ------------------------------------------------------- | | groupID | string | 是 | 群ID | | newOwnerUserID | string | 是 | 新群主用户 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.transferGroupOwner({ +OpenIMSDK.transferGroupOwner({ groupID: '', newOwnerUserID: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/initialization/getLoginStatus.mdx b/docs/sdks/api/initialization/getLoginStatus.mdx index 80cb2fc70c..9bb5682293 100644 --- a/docs/sdks/api/initialization/getLoginStatus.mdx +++ b/docs/sdks/api/initialization/getLoginStatus.mdx @@ -193,33 +193,33 @@ IMSDK.asyncApi('getLoginStatus', 'operationID'); ### 函数原型 ```js showLineNumbers -OpenIMSDKRN.getLoginStatus(operationID: string): Promise +OpenIMSDK.getLoginStatus(operationID?: string): Promise ``` ### 输入参数 -| 参数名称 | 参数类型 | 描述 | -| -------- | -------- | --------------------------------------- | -| operationID | string | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| 参数名称 | 参数类型 | 是否必填 | 描述 | +| -------- | -------- | -------- | --------------------------------------- | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ---------------- | | Promise.then() | Promise<[LoginStatus](docs/sdks/enum/loginStatus.mdx)\> | 当前用户登录状态 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getLoginStatus("operationID"); +OpenIMSDK.getLoginStatus(); .then((data) => { // data: 登录状态LoginStatus }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/initialization/getLoginUserID.mdx b/docs/sdks/api/initialization/getLoginUserID.mdx index b22c6e76f9..27d576905f 100644 --- a/docs/sdks/api/initialization/getLoginUserID.mdx +++ b/docs/sdks/api/initialization/getLoginUserID.mdx @@ -189,7 +189,7 @@ IMSDK.asyncApi('getLoginUserID', 'operationID') ### 函数原型 ```js showLineNumbers -OpenIMSDKRN.getLoginUserID(operationID: string): Promise +OpenIMSDK.getLoginUserID(operationID?: string): Promise ``` ### 返回结果 @@ -197,23 +197,22 @@ OpenIMSDKRN.getLoginUserID(operationID: string): Promise | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | --------------- | | Promise.then() | Promise | 当前登录用户 ID | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getLoginUserID("operationID"); +OpenIMSDK.getLoginUserID(); .then((data) => { // data: 当前登录用户userID }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` - diff --git a/docs/sdks/api/initialization/initSDK.mdx b/docs/sdks/api/initialization/initSDK.mdx index 622281026d..068c48a358 100644 --- a/docs/sdks/api/initialization/initSDK.mdx +++ b/docs/sdks/api/initialization/initSDK.mdx @@ -320,8 +320,8 @@ export const getDbDir = () => ### 函数原型 -```js showLineNumbers -OpenIMSDKRN.initSDK(config: InitConfig, optionalID:string): Promise +```ts showLineNumbers +OpenIMSDK.initSDK(config: InitConfig, optionalID? :string): Promise ``` ### 输入参数 @@ -329,31 +329,32 @@ OpenIMSDKRN.initSDK(config: InitConfig, optionalID:string): Promise | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------- | ------------------------------------------------ | -------- | ---------- | | config | [InitConfig](docs/sdks/class/init/config.mdx) | 是 | 初始化参数 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数| +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数| ### 返回结果 - + | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | -------------- | | Promise.then() | Promise | 是否初始化成功 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | - +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | + ### 代码示例 - + ```ts showLineNumbers -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; import RNFS from 'react-native-fs'; RNFS.mkdir(RNFS.DocumentDirectoryPath + '/tmp'); -OpenIMSDKRN.initSDK({ +OpenIMSDK.initSDK({ platformID: 2, // 1: ios, 2: android apiAddr: 'http://your-server-ip:10002', wsAddr: 'ws://your-server-ip:10001', dataDir: RNFS.DocumentDirectoryPath + '/tmp', + logFilePath: RNFS.DocumentDirectoryPath + '/tmp', logLevel: 5, isLogStandardOutput: true, -}, 'operationID'); +}); ``` diff --git a/docs/sdks/api/initialization/login.mdx b/docs/sdks/api/initialization/login.mdx index 2e5801df32..747aea88f7 100644 --- a/docs/sdks/api/initialization/login.mdx +++ b/docs/sdks/api/initialization/login.mdx @@ -290,10 +290,10 @@ IMSDK.asyncApi('login', IMSDK.uuid(), { ### 函数原型 ```js showLineNumbers -OpenIMSDKRN.login({ +OpenIMSDK.login({ userID:string, token:string -}, operationID:string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -302,28 +302,28 @@ OpenIMSDKRN.login({ | ----------- | -------- | -------- | ------------------------------------------------------------------- | --- | | userID | String | 是 | IM 用户 userID | | token | String | 是 | OpenIM 用户令牌,业务后台验证用户账号密码后,通过 user_token 来获取 | | -| operationID | String | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | String | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; -OpenIMSDKRN.login({ +OpenIMSDK.login({ userID: 'IM user ID', token: 'IM user token', -}, 'operationID') +}) .then(() => { // 登录成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 登录失败 }); ``` diff --git a/docs/sdks/api/initialization/logout.mdx b/docs/sdks/api/initialization/logout.mdx index 9a083b7cda..d2ef6245c4 100644 --- a/docs/sdks/api/initialization/logout.mdx +++ b/docs/sdks/api/initialization/logout.mdx @@ -224,33 +224,33 @@ IMSDK.asyncApi('logout', IMSDK.uuid()) ### 函数原型 ```js showLineNumbers -OpenIMSDKRN.logout(operationID: string): Promise +OpenIMSDK.logout(operationID?: string): Promise ``` ### 参数详解 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------- | --------------------------------------- | -------- | -------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.logout("operationID") +OpenIMSDK.logout() .then(() => { // 退出登录成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/initialization/unInitSDK.mdx b/docs/sdks/api/initialization/unInitSDK.mdx index 6656971399..a9253565a7 100644 --- a/docs/sdks/api/initialization/unInitSDK.mdx +++ b/docs/sdks/api/initialization/unInitSDK.mdx @@ -146,32 +146,32 @@ IMSDK.asyncApi('unInitSDK', IMSDK.uuid(), config) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.unInitSDK(operationID: string): Promise +OpenIMSDK.unInitSDK(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | --------------------------------------------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | -------------- | | Promise.then() | Promise | 是否反初始化成功 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.unInitSDK("operationID") +OpenIMSDK.unInitSDK() .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createCardMessage.mdx b/docs/sdks/api/message/createCardMessage.mdx index 42d432203c..5762cdd1ac 100644 --- a/docs/sdks/api/message/createCardMessage.mdx +++ b/docs/sdks/api/message/createCardMessage.mdx @@ -248,12 +248,12 @@ IMSDK.asyncApi('createCardMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.login({ +OpenIMSDK.login({ userID:string, nickname:string, faceURL:string, ex:string -}, operationID:string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -264,29 +264,29 @@ OpenIMSDKRN.login({ | nickname | string | 是 | 用户昵称 | | faceURL | string | 是 | 用户头像URL | | ex | string | 是 | 扩展信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createCardMessage({ +OpenIMSDK.createCardMessage({ userID: '', nickname: '', faceURL: '', ex: '', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createCustomMessage.mdx b/docs/sdks/api/message/createCustomMessage.mdx index 3eec01f701..d3a3d0b30c 100644 --- a/docs/sdks/api/message/createCustomMessage.mdx +++ b/docs/sdks/api/message/createCustomMessage.mdx @@ -244,11 +244,11 @@ IMSDK.asyncApi('createCustomMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createCustomMessage({ +OpenIMSDK.createCustomMessage({ data: string, extension: string, description: string -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -258,29 +258,29 @@ OpenIMSDKRN.createCustomMessage({ | data | String | 是 | 文本内容 | | extension | String | 是 | 拓展内容 | | description | String | 是 | 描述内容 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createCustomMessage({ +OpenIMSDK.createCustomMessage({ data: '', extension: '', description: '', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createFaceMessage.mdx b/docs/sdks/api/message/createFaceMessage.mdx index 1933519e06..3bfb9cd975 100644 --- a/docs/sdks/api/message/createFaceMessage.mdx +++ b/docs/sdks/api/message/createFaceMessage.mdx @@ -238,10 +238,10 @@ IMSDK.asyncApi('createFaceMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createFaceMessage({ +OpenIMSDK.createFaceMessage({ index: number; dataStr: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -250,7 +250,7 @@ OpenIMSDKRN.createFaceMessage({ | ----------- | -------- | -------- | ------------------------------------------------------- | | index | number | 是 | 索引 | | dataStr | string | 是 | 内容 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -258,21 +258,21 @@ OpenIMSDKRN.createFaceMessage({ | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createFaceMessage({ +OpenIMSDK.createFaceMessage({ index: 0, dataStr: 'https://xxx/xxx/xx.png', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createFileMessageByURL.mdx b/docs/sdks/api/message/createFileMessageByURL.mdx index e7a721f13e..d0ac0f9c9a 100644 --- a/docs/sdks/api/message/createFileMessageByURL.mdx +++ b/docs/sdks/api/message/createFileMessageByURL.mdx @@ -257,14 +257,14 @@ IMSDK.asyncApi('createFileMessageByURL', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createFileMessageByURL( { +OpenIMSDK.createFileMessageByURL( { filePath: string, fileName: string, uuid: string, sourceUrl: string, fileSize: number, fileType: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -277,31 +277,31 @@ OpenIMSDKRN.createFileMessageByURL( { | sourceUrl | string | 是 | 图片下载地址,自行上文件后获得的远程 url 地址,需要通过[sendMessageNotOss](docs/sdks/api/message/sendMessageNotOss.mdx) 发送 | | fileSize | string | 是 | 文件大小 | | fileType | string | 是 | 文件类型,一般为后缀名 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createFileMessageByURL({ +OpenIMSDK.createFileMessageByURL({ filePath: '', fileName: 'fileName.mp4', uuid: 'uuid', sourceUrl: 'https://sourceUrl.mp4', fileSize: 1024, fileType: 'mp4', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createFileMessageFromFullPath.mdx b/docs/sdks/api/message/createFileMessageFromFullPath.mdx index 08a1fc75c4..1e71567b2c 100644 --- a/docs/sdks/api/message/createFileMessageFromFullPath.mdx +++ b/docs/sdks/api/message/createFileMessageFromFullPath.mdx @@ -229,10 +229,10 @@ IMSDK.asyncApi('createFileMessageFromFullPath', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createFileMessageFromFullPath({ +OpenIMSDK.createFileMessageFromFullPath({ filePath: string, fileName: string -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -241,30 +241,30 @@ OpenIMSDKRN.createFileMessageFromFullPath({ | ----------- | -------- | -------- | ------------------------------------------------------- | | filePath | number | 是 | 文件绝对路径 | | fileName | string | 是 | 文件名称 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createFileMessageFromFullPath({ +OpenIMSDK.createFileMessageFromFullPath({ filePath: '', fileName: '', -}, 'operationID') +}) .then(({ data }) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createForwardMessage.mdx b/docs/sdks/api/message/createForwardMessage.mdx index ad6abbcea2..733151b339 100644 --- a/docs/sdks/api/message/createForwardMessage.mdx +++ b/docs/sdks/api/message/createForwardMessage.mdx @@ -215,7 +215,7 @@ IMSDK.asyncApi('createForwardMessage', IMSDK.uuid(), message) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createForwardMessage( message: MessageItem, operationID: string): Promise +OpenIMSDK.createForwardMessage( message: MessageItem, operationID?: string): Promise ``` ### 输入参数 @@ -223,27 +223,27 @@ OpenIMSDKRN.createForwardMessage( message: MessageItem, operationID: string): Pr | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | ------------------------------------------------------ | -------- | ------------------------------------------------------- | | message | [MessageItem](docs/sdks/class/message/messageInfo.mdx) | 是 | 要转发的消息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const message = {...} as MessageItem; -OpenIMSDKRN.createForwardMessage(message, 'operationID') +OpenIMSDK.createForwardMessage(message) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createImageMessageByURL.mdx b/docs/sdks/api/message/createImageMessageByURL.mdx index 7fb5afab77..378971a6e7 100644 --- a/docs/sdks/api/message/createImageMessageByURL.mdx +++ b/docs/sdks/api/message/createImageMessageByURL.mdx @@ -284,11 +284,11 @@ IMSDK.asyncApi( ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createImageMessageByURL({ +OpenIMSDK.createImageMessageByURL({ sourcePicture: PicBaseInfo, bigPicture: PicBaseInfo, snapshotPicture: PicBaseInfo, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -299,18 +299,19 @@ OpenIMSDKRN.createImageMessageByURL({ | bigPicture | [PicBaseInfo](docs/sdks/class/message/pictureInfo.mdx) | 是 | 大图相关信息 | | snapshotPicture | [PicBaseInfo](docs/sdks/class/message/pictureInfo.mdx) | 是 | 缩略图相关信息 | | sourcePath | string | 是 | 图片在本机的绝对路径,如果没有传空字符即可 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | + ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const picBaseInfo = { uuid: 'uuid', @@ -321,16 +322,16 @@ const picBaseInfo = { url: 'http://xxx.com/xxx.png', }; -OpenIMSDKRN.createImageMessageByURL({ +OpenIMSDK.createImageMessageByURL({ sourcePicture: picBaseInfo, bigPicture: picBaseInfo, snapshotPicture: picBaseInfo, sourcePath: "" -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createImageMessageFromFullPath.mdx b/docs/sdks/api/message/createImageMessageFromFullPath.mdx index b75b0ea909..6e265a5874 100644 --- a/docs/sdks/api/message/createImageMessageFromFullPath.mdx +++ b/docs/sdks/api/message/createImageMessageFromFullPath.mdx @@ -213,14 +213,14 @@ IMSDK.asyncApi('createImageMessageFromFullPath', IMSDK.uuid(), 'imagePath') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createImageMessageFromFullPath(imagePath: string, operationID: string): Promise +OpenIMSDK.createImageMessageFromFullPath(imagePath: string, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | imagePath | string | 是 | 图片绝对路径 | ### 返回结果 @@ -228,18 +228,18 @@ OpenIMSDKRN.createImageMessageFromFullPath(imagePath: string, operationID: strin | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createImageMessageFromFullPath('imagePath', 'operationID') +OpenIMSDK.createImageMessageFromFullPath('imagePath') .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createLocationMessage.mdx b/docs/sdks/api/message/createLocationMessage.mdx index ee1d58cc16..011a3dbde5 100644 --- a/docs/sdks/api/message/createLocationMessage.mdx +++ b/docs/sdks/api/message/createLocationMessage.mdx @@ -245,11 +245,11 @@ IMSDK.asyncApi('createLocationMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createLocationMessage({ +OpenIMSDK.createLocationMessage({ description: string, longitude: number, latitude: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -259,29 +259,29 @@ OpenIMSDKRN.createLocationMessage({ | description | string | 是 | 位置描述 | | latitude | number | 是 | 纬度 | | longitude | number | 是 | 经度 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createLocationMessage({ +OpenIMSDK.createLocationMessage({ description: '', longitude: 0, latitude: 0, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createMergeMessage.mdx b/docs/sdks/api/message/createMergeMessage.mdx index 73c2e9726d..750919993f 100644 --- a/docs/sdks/api/message/createMergeMessage.mdx +++ b/docs/sdks/api/message/createMergeMessage.mdx @@ -257,11 +257,11 @@ IMSDK.asyncApi('createMergerMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createMergerMessage({ +OpenIMSDK.createMergerMessage({ title: string, messageList: Array, summaryList: Array, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -271,21 +271,21 @@ OpenIMSDKRN.createMergerMessage({ | messageList | [MessageItem](docs/sdks/class/message/messageInfo.mdx)[] | 是 | 消息列表 | | title | string | 是 | 标题 | | summaryList | string[] | 是 | 消息摘要列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createMergerMessage({ +OpenIMSDK.createMergerMessage({ messageList: [ { // message @@ -298,7 +298,7 @@ OpenIMSDKRN.createMergerMessage({ .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createQuoteMessage.mdx b/docs/sdks/api/message/createQuoteMessage.mdx index a587dde08a..9d2fb443c7 100644 --- a/docs/sdks/api/message/createQuoteMessage.mdx +++ b/docs/sdks/api/message/createQuoteMessage.mdx @@ -235,17 +235,17 @@ IMSDK.asyncApi('createQuoteMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createQuoteMessage({ +OpenIMSDK.createQuoteMessage({ text: string, message: MessageItem, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | ------------------------------------------------------ | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | text | string | 是 | 文本内容 | | message | [MessageItem](docs/sdks/class/message/messageInfo.mdx) | 是 | 被引用消息 | @@ -254,25 +254,25 @@ OpenIMSDKRN.createQuoteMessage({ | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const message = { ... } as MessageItem -OpenIMSDKRN.createQuoteMessage({ +OpenIMSDK.createQuoteMessage({ text: '', message: { ... }, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createSoundMessageByURL.mdx b/docs/sdks/api/message/createSoundMessageByURL.mdx index 2e60bdf6c3..1a159b1414 100644 --- a/docs/sdks/api/message/createSoundMessageByURL.mdx +++ b/docs/sdks/api/message/createSoundMessageByURL.mdx @@ -257,14 +257,14 @@ IMSDK.asyncApi('createSoundMessageByURL', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createSoundMessageByURL({ +OpenIMSDK.createSoundMessageByURL({ uuid: string, soundPath: string, sourceUrl: string, dataSize: number, duration: number, soundType: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -277,32 +277,32 @@ OpenIMSDKRN.createSoundMessageByURL({ | sourceUrl | string | 是 | 图片下载地址,自行上文件并通过[sendMessageNotOss](docs/sdks/api/message/sendMessageNotOss.mdx) 发送时,需要传入远程 url,否则为空字符串 | | dataSize | string | 是 | 文件大小 | | soundType | string | 是 | 文件类型,一般为后缀名 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createSoundMessageByURL({ +OpenIMSDK.createSoundMessageByURL({ soundPath: '', duration: 6, uuid: 'uuid', sourceUrl: '', dataSize: 1024, soundType: 'mp3', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createSoundMessageFromFullPath.mdx b/docs/sdks/api/message/createSoundMessageFromFullPath.mdx index 89a9579678..a350162abd 100644 --- a/docs/sdks/api/message/createSoundMessageFromFullPath.mdx +++ b/docs/sdks/api/message/createSoundMessageFromFullPath.mdx @@ -226,10 +226,10 @@ IMSDK.asyncApi('createSoundMessageFromFullPath', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createSoundMessageFromFullPath({ +OpenIMSDK.createSoundMessageFromFullPath({ soundPath: string, duration: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -238,28 +238,28 @@ OpenIMSDKRN.createSoundMessageFromFullPath({ | ----------- | -------- | -------- | ------------------------------------------------------- | | soundPath | string | 是 | 文件绝对路径 | | duration | number | 是 | 录音时长 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createSoundMessageFromFullPath({ +OpenIMSDK.createSoundMessageFromFullPath({ soundPath: 'soundPath', duration: 6, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createTextAtMessage.mdx b/docs/sdks/api/message/createTextAtMessage.mdx index 1fdf68b3f9..e298eae5ae 100644 --- a/docs/sdks/api/message/createTextAtMessage.mdx +++ b/docs/sdks/api/message/createTextAtMessage.mdx @@ -305,12 +305,12 @@ IMSDK.asyncApi('createTextAtMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createTextAtMessage({ +OpenIMSDK.createTextAtMessage({ text: string, atUserIDList: string[], atUsersInfo: AtUsersInfoItem[]; message?: MessageItem; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -321,21 +321,21 @@ OpenIMSDKRN.createTextAtMessage({ | atUserIDList | string[] | 是 | @人的 userID 列表 | | atUsersInfo | [AtUsersInfoItem](docs/sdks/class/message/atInfo.mdx)[] | 是 | @人的用户信息列表 | | message | [MessageItem](docs/sdks/class/message/messageInfo.mdx) | 是 | 引用的消息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createTextAtMessage({ +OpenIMSDK.createTextAtMessage({ text: "", atUserIDList: ['userID'], atUsersInfo: [ @@ -348,11 +348,11 @@ OpenIMSDKRN.createTextAtMessage({ // MessageItem ... } -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createTextMessage.mdx b/docs/sdks/api/message/createTextMessage.mdx index 06717d6c7b..e72c2e7f9c 100644 --- a/docs/sdks/api/message/createTextMessage.mdx +++ b/docs/sdks/api/message/createTextMessage.mdx @@ -210,7 +210,7 @@ IMSDK.asyncApi('createTextMessage', IMSDK.uuid(), 'text') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createTextMessage(textMsg: string,operationID: string): Promise +OpenIMSDK.createTextMessage(textMsg: string, operationID?: string): Promise ``` ### 输入参数 @@ -218,26 +218,26 @@ OpenIMSDKRN.createTextMessage(textMsg: string,operationID: string): Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createTextMessage('text', 'operationID') +OpenIMSDK.createTextMessage('text') .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createVideoMessageByURL.mdx b/docs/sdks/api/message/createVideoMessageByURL.mdx index 17c70c36b4..3059b6d85c 100644 --- a/docs/sdks/api/message/createVideoMessageByURL.mdx +++ b/docs/sdks/api/message/createVideoMessageByURL.mdx @@ -303,7 +303,7 @@ IMSDK.asyncApi('createVideoMessageByURL', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createVideoMessageByURL({ +OpenIMSDK.createVideoMessageByURL({ videoPath: string, duration: number, videoType: string, @@ -317,7 +317,7 @@ OpenIMSDKRN.createVideoMessageByURL({ snapshotWidth: number, snapshotHeight: number, snapShotType: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -337,21 +337,21 @@ OpenIMSDKRN.createVideoMessageByURL({ | snapshotWidth | number | 是 | 视频缩略图宽度 | | snapshotHeight | number | 是 | 视频缩略图高度 | | snapShotType | string | 是 | 视频缩略图类型,一般为后缀名 | | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createVideoMessageByURL({ +OpenIMSDK.createVideoMessageByURL({ videoPath: '', duration: 6, videoType: 'mp4', @@ -365,11 +365,11 @@ OpenIMSDKRN.createVideoMessageByURL({ snapshotWidth: 1024, snapshotHeight: 1024, snapShotType: 'png', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/createVideoMessageFromFullPath.mdx b/docs/sdks/api/message/createVideoMessageFromFullPath.mdx index fd4dda83aa..b9e293d53d 100644 --- a/docs/sdks/api/message/createVideoMessageFromFullPath.mdx +++ b/docs/sdks/api/message/createVideoMessageFromFullPath.mdx @@ -251,12 +251,12 @@ IMSDK.asyncApi('createVideoMessageFromFullPath', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.createVideoMessageFromFullPath({ +OpenIMSDK.createVideoMessageFromFullPath({ videoPath: string, videoType: string, duration: number, snapshotPath: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -267,30 +267,30 @@ OpenIMSDKRN.createVideoMessageFromFullPath({ | videoType | string | 是 | 视频类型,一般为后缀名 | | duration | number | 是 | 时长 | | snapshotPath | string | 是 | 视频封面绝对路径 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------- | ------------ | | Promise.then() | Promise<[MessageItem](docs/sdks/class/message/messageInfo.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.createVideoMessageFromFullPath({ +OpenIMSDK.createVideoMessageFromFullPath({ videoPath: '', videoType: 'mp4', duration: 12, snapshotPath: '', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/deleteAllMsgFromLocal.mdx b/docs/sdks/api/message/deleteAllMsgFromLocal.mdx index b1f23ce20b..23a1dc3ac3 100644 --- a/docs/sdks/api/message/deleteAllMsgFromLocal.mdx +++ b/docs/sdks/api/message/deleteAllMsgFromLocal.mdx @@ -215,32 +215,32 @@ IMSDK.asyncApi('deleteAllMsgFromLocal', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.deleteAllMsgFromLocal(operationID: string): Promise +OpenIMSDK.deleteAllMsgFromLocal(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.deleteAllMsgFromLocal('operationID') +OpenIMSDK.deleteAllMsgFromLocal() .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/deleteAllMsgFromLocalAndSvr.mdx b/docs/sdks/api/message/deleteAllMsgFromLocalAndSvr.mdx index 6c0c409fff..508cb2ace4 100644 --- a/docs/sdks/api/message/deleteAllMsgFromLocalAndSvr.mdx +++ b/docs/sdks/api/message/deleteAllMsgFromLocalAndSvr.mdx @@ -218,32 +218,32 @@ IMSDK.asyncApi('deleteAllMsgFromLocalAndSvr', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.deleteAllMsgFromLocalAndSvr(operationID: string): Promise +OpenIMSDK.deleteAllMsgFromLocalAndSvr(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.deleteAllMsgFromLocalAndSvr('operationID') +OpenIMSDK.deleteAllMsgFromLocalAndSvr() .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/deleteMessage.mdx b/docs/sdks/api/message/deleteMessage.mdx index 1016818ce1..a3555d44e7 100644 --- a/docs/sdks/api/message/deleteMessage.mdx +++ b/docs/sdks/api/message/deleteMessage.mdx @@ -259,17 +259,17 @@ IMSDK.asyncApi('deleteMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.deleteMessage({ +OpenIMSDK.deleteMessage({ conversationID: string, clientMsgID:string -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 是 | 会话 ID | | clientMsgID | string | 是 | 消息 ID | @@ -278,21 +278,21 @@ OpenIMSDKRN.deleteMessage({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.deleteMessage({ +OpenIMSDK.deleteMessage({ conversationID: '', clientMsgID: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/deleteMessageFromLocalStorage.mdx b/docs/sdks/api/message/deleteMessageFromLocalStorage.mdx index 787434174e..72d8174cf1 100644 --- a/docs/sdks/api/message/deleteMessageFromLocalStorage.mdx +++ b/docs/sdks/api/message/deleteMessageFromLocalStorage.mdx @@ -249,17 +249,17 @@ IMSDK.asyncApi('deleteMessageFromLocalStorage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.deleteMessageFromLocalStorage({ +OpenIMSDK.deleteMessageFromLocalStorage({ conversationID: string, clientMsgID:string -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 是 | 会话 ID | | clientMsgID | string | 是 | 消息 ID | @@ -268,21 +268,21 @@ OpenIMSDKRN.deleteMessageFromLocalStorage({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.deleteMessageFromLocalStorage({ +OpenIMSDK.deleteMessageFromLocalStorage({ conversationID: '', clientMsgID: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/findMessageList.mdx b/docs/sdks/api/message/findMessageList.mdx index 9800d53db2..e6ce50b621 100644 --- a/docs/sdks/api/message/findMessageList.mdx +++ b/docs/sdks/api/message/findMessageList.mdx @@ -288,10 +288,10 @@ IMSDK.asyncApi('findMessageList', IMSDK.uuid(), { > [`SearchMessageResultItem`](docs/sdks/class/message/searchResultItem.mdx) ```ts showLineNumbers -OpenIMSDKRN.findMessageList({ +OpenIMSDK.findMessageList({ conversationID: string, clientMsgIDList: string[] -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -300,31 +300,30 @@ OpenIMSDKRN.findMessageList({ | --------------- | -------- | -------- | ------------------------------------------------------- | | conversationID | string | 是 | 会话 ID | | clientMsgIDList | string[] | 是 | 消息 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; -OpenIMSDKRN.findMessageList( +OpenIMSDK.findMessageList( { conversationID: '', clientMsgIDList: ['msgid'], }, - 'operationID' ) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/getAdvancedHistoryMessageList.mdx b/docs/sdks/api/message/getAdvancedHistoryMessageList.mdx index d156d1cf91..077589c49f 100644 --- a/docs/sdks/api/message/getAdvancedHistoryMessageList.mdx +++ b/docs/sdks/api/message/getAdvancedHistoryMessageList.mdx @@ -274,12 +274,12 @@ IMSDK.asyncApi('getAdvancedHistoryMessageList', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getAdvancedHistoryMessageList({ +OpenIMSDK.getAdvancedHistoryMessageList({ lastMinSeq: number; count: number; startClientMsgID: string; conversationID: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -289,31 +289,31 @@ OpenIMSDKRN.getAdvancedHistoryMessageList({ | conversationID | string | 是 | 会话 ID | | startClientMsgID | string | 是 | 起始的消息 clientMsgID,第一次拉取为"",后续为上一次拉取的最后一条消息的 clientMsgID | | count | number | 是 | 一次拉取的数量 | -| lastMinSeq | number | 是 | lastMinSeq 是上一次拉取回调给的值,上下文,第二次拉取需要回传 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| viewType | [ViewType](docs/sdks/enum/viewType.mdx) | 是 | 判断为正常拉取聊天记录,还是搜索后获取消息上下文 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[AdvancedGetMessageResult](docs/sdks/class/message/advancedHistoryInfo.mdx)> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getAdvancedHistoryMessageList({ +OpenIMSDK.getAdvancedHistoryMessageList({ lastMinSeq: 0, count: 20, startClientMsgID: '', conversationID: 'conversationID', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/getAdvancedHistoryMessageListReverse.mdx b/docs/sdks/api/message/getAdvancedHistoryMessageListReverse.mdx index 6a8c62a499..424440951c 100644 --- a/docs/sdks/api/message/getAdvancedHistoryMessageListReverse.mdx +++ b/docs/sdks/api/message/getAdvancedHistoryMessageListReverse.mdx @@ -267,12 +267,12 @@ IMSDK.asyncApi('getAdvancedHistoryMessageListReverse', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getAdvancedHistoryMessageListReverse({ +OpenIMSDK.getAdvancedHistoryMessageListReverse({ lastMinSeq: number; count: number; startClientMsgID: string; conversationID: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -282,31 +282,31 @@ OpenIMSDKRN.getAdvancedHistoryMessageListReverse({ | conversationID | string | 是 | 会话 ID | | startClientMsgID | string | 是 | 起始的消息 clientMsgID,第一次拉取为"",后续为上一次拉取的最后一条消息的 clientMsgID | | count | number | 是 | 一次拉取的数量 | -| lastMinSeq | number | 是 | lastMinSeq 是上一次拉取回调给的值,上下文,第二次拉取需要回传 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| viewType | [ViewType](docs/sdks/enum/viewType.mdx) | 是 | 判断为正常拉取聊天记录,还是搜索后获取消息上下文 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------------------------ | ------------ | | Promise.then() | Promise<[AdvancedGetMessageResult](docs/sdks/class/message/advancedHistoryInfo.mdx)> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getAdvancedHistoryMessageListReverse({ +OpenIMSDK.getAdvancedHistoryMessageListReverse({ lastMinSeq: 0, count: 20, startClientMsgID: '', conversationID: 'conversationID', -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/insertGroupMessageToLocalStorage.mdx b/docs/sdks/api/message/insertGroupMessageToLocalStorage.mdx index 3183e27ea5..99df353214 100644 --- a/docs/sdks/api/message/insertGroupMessageToLocalStorage.mdx +++ b/docs/sdks/api/message/insertGroupMessageToLocalStorage.mdx @@ -271,18 +271,18 @@ IMSDK.asyncApi( ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.insertGroupMessageToLocalStorage({ +OpenIMSDK.insertGroupMessageToLocalStorage({ message: MessageItem; groupID: string; sendID: string; -},operationID: string): Promise +},operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | ------------------------------------------------------ | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | message | [MessageItem](docs/sdks/class/message/messageInfo.mdx) | 是 | 消息体 | | groupID | string | 是 | 接收消息的 groupID | | sendID | string | 是 | 发送消息的 userID | @@ -292,25 +292,25 @@ OpenIMSDKRN.insertGroupMessageToLocalStorage({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.insertGroupMessageToLocalStorage({ +OpenIMSDK.insertGroupMessageToLocalStorage({ message: { // MessageItem ... - }; + }, groupID: "", sendID: "", -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/insertSingleMessageToLocalStorage.mdx b/docs/sdks/api/message/insertSingleMessageToLocalStorage.mdx index 18302f600c..38715926c6 100644 --- a/docs/sdks/api/message/insertSingleMessageToLocalStorage.mdx +++ b/docs/sdks/api/message/insertSingleMessageToLocalStorage.mdx @@ -273,18 +273,18 @@ IMSDK.asyncApi( ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.insertSingleMessageToLocalStorage({ +OpenIMSDK.insertSingleMessageToLocalStorage({ message: MessageItem; recvID: string; sendID: string; -},operationID: string): Promise +},operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | ------------------------------------------------------ | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | message | [MessageItem](docs/sdks/class/message/messageInfo.mdx) | 是 | 消息体 | | recvID | string | 是 | 接收消息的 groupID | | sendID | string | 是 | 发送消息的 userID | @@ -294,25 +294,25 @@ OpenIMSDKRN.insertSingleMessageToLocalStorage({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.insertSingleMessageToLocalStorage({ +OpenIMSDK.insertSingleMessageToLocalStorage({ message: { // MessageItem ... - }; + }, recvID: "", sendID: "", -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/revokeMessage.mdx b/docs/sdks/api/message/revokeMessage.mdx index 4f20b66a1c..e51646b260 100644 --- a/docs/sdks/api/message/revokeMessage.mdx +++ b/docs/sdks/api/message/revokeMessage.mdx @@ -258,10 +258,10 @@ IMSDK.asyncApi('revokeMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.revokeMessage({ +OpenIMSDK.revokeMessage({ conversationID: string, clientMsgID: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -270,28 +270,28 @@ OpenIMSDKRN.revokeMessage({ | -------------- | -------- | -------- | ------------------------------------------------------- | | conversationID | string | 是 | 会话 ID | | clientMsgID | string | 是 | 消息 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.revokeMessage({ +OpenIMSDK.revokeMessage({ conversationID: '', clientMsgID: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/searchLocalMessages.mdx b/docs/sdks/api/message/searchLocalMessages.mdx index de15f52da1..b5b2d288a2 100644 --- a/docs/sdks/api/message/searchLocalMessages.mdx +++ b/docs/sdks/api/message/searchLocalMessages.mdx @@ -361,7 +361,7 @@ type SearchMessageResult = { searchResultItems: SearchMessageResultItem[]; }; -OpenIMSDKRN.searchLocalMessages( { +OpenIMSDK.searchLocalMessages( { conversationID?: string, keywordList: string[], keywordListMatchType?: number, @@ -371,14 +371,14 @@ OpenIMSDKRN.searchLocalMessages( { searchTimePeriod: number, pageIndex: number, count: number, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------------- | ------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 否 | 根据会话查询,如果是全局搜索传空字符串即可 | | keywordList | string[] | 是 | 搜索关键词列表,目前仅支持一个关键词搜索 | | keywordListMatchType | number | 否 | 关键词匹配模式,1 代表与,2 代表或,暂时未用 | @@ -394,14 +394,14 @@ OpenIMSDKRN.searchLocalMessages( { | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.searchLocalMessages({ +OpenIMSDK.searchLocalMessages({ conversationID: '', keywordList: ['keyword'], keywordListMatchType: 0, @@ -411,11 +411,11 @@ OpenIMSDKRN.searchLocalMessages({ searchTimePeriod: 0, pageIndex: 1, count: 20, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/sendMessage.mdx b/docs/sdks/api/message/sendMessage.mdx index 0570988cef..725678a6f9 100644 --- a/docs/sdks/api/message/sendMessage.mdx +++ b/docs/sdks/api/message/sendMessage.mdx @@ -303,12 +303,12 @@ IMSDK.asyncApi('sendMessage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.sendMessage({ +OpenIMSDK.sendMessage({ recvID: string, groupID: string, offlinePushInfo?: OfflinePush, message: MessageItem, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -319,21 +319,21 @@ OpenIMSDKRN.sendMessage({ | recvID | string | 是 | 接收消息的 user ID,发送群消息时传空字符串 | | groupID | string | 是 | 接收消息的 group ID,发送单聊消息时传空字符串 | | offlinePushInfo | [OfflinePushInfo](docs/sdks/class/message/offlinePushInfo.mdx) | 是 | 离线消息体 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.sendMessage({ +OpenIMSDK.sendMessage({ recvID: "userID", groupID: "", message: { @@ -347,11 +347,11 @@ OpenIMSDKRN.sendMessage({ iOSPushSound: '+1', iOSBadgeCount: true, } -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/sendMessageNotOss.mdx b/docs/sdks/api/message/sendMessageNotOss.mdx index 33580dfbfd..390da648ca 100644 --- a/docs/sdks/api/message/sendMessageNotOss.mdx +++ b/docs/sdks/api/message/sendMessageNotOss.mdx @@ -304,12 +304,12 @@ IMSDK.asyncApi('sendMessageNotOss', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.sendMessageNotOss({ +OpenIMSDK.sendMessageNotOss({ recvID: string; groupID: string; offlinePushInfo?: OfflinePush; message: MessageItem; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -320,21 +320,21 @@ OpenIMSDKRN.sendMessageNotOss({ | recvID | string | 是 | 接收消息的 user ID,发送群消息时传空字符串 | | groupID | string | 是 | 接收消息的 group ID,发送单聊消息时传空字符串 | | offlinePushInfo | [OfflinePushInfo](docs/sdks/class/message/offlinePushInfo.mdx) | 是 | 离线消息体 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.sendMessageNotOss({ +OpenIMSDK.sendMessageNotOss({ recvID: "userID", groupID: "", message: { @@ -348,11 +348,11 @@ OpenIMSDKRN.sendMessageNotOss({ iOSPushSound: '+1', iOSBadgeCount: true, } -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/setMessageLocalEx.mdx b/docs/sdks/api/message/setMessageLocalEx.mdx index 2077bceebe..d4bc9550f9 100644 --- a/docs/sdks/api/message/setMessageLocalEx.mdx +++ b/docs/sdks/api/message/setMessageLocalEx.mdx @@ -254,18 +254,18 @@ IMSDK.asyncApi('setMessageLocalEx', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setMessageLocalEx( { +OpenIMSDK.setMessageLocalEx( { conversationID: string; clientMsgID: string; localEx: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | -------------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | conversationID | string | 是 | 会话 ID | | clientMsgID | string | 是 | 消息 ID | | localEx | string | 是 | 要设置的 ex 信息 | @@ -275,22 +275,22 @@ OpenIMSDKRN.setMessageLocalEx( { | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.setMessageLocalEx({ +OpenIMSDK.setMessageLocalEx({ conversationID: 'conversationID', clientMsgID: 'clientMsgID', localEx: 'localEx', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/message/typingStatusUpdate.mdx b/docs/sdks/api/message/typingStatusUpdate.mdx index 2b3097c91e..f410389af5 100644 --- a/docs/sdks/api/message/typingStatusUpdate.mdx +++ b/docs/sdks/api/message/typingStatusUpdate.mdx @@ -250,10 +250,10 @@ IMSDK.asyncApi('typingStatusUpdate', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.typingStatusUpdate({ +OpenIMSDK.typingStatusUpdate({ recvID: string, msgTip: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -262,28 +262,28 @@ OpenIMSDKRN.typingStatusUpdate({ | ----------- | -------- | -------- | ------------------------------------------------------- | | recvID | string | 是 | 接收者 ID | | msgTip | string | 是 | 自定义内容提示 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.typingStatusUpdate({ +OpenIMSDK.typingStatusUpdate({ recvID: 'recvID', msgTip: 'yes', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/acceptFriendApplication.mdx b/docs/sdks/api/relation/acceptFriendApplication.mdx index 37135d4b59..6a156d45be 100644 --- a/docs/sdks/api/relation/acceptFriendApplication.mdx +++ b/docs/sdks/api/relation/acceptFriendApplication.mdx @@ -247,10 +247,10 @@ IMSDK.asyncApi('acceptFriendApplication', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.acceptFriendApplication({ +OpenIMSDK.acceptFriendApplication({ toUserID: string; handleMsg: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -259,28 +259,28 @@ OpenIMSDKRN.acceptFriendApplication({ | ----------- | -------- | -------- | ------------------------------------------------------- | | toUserID | string | 是 | 申请发起者用户 ID | | handleMsg | string | 是 | 操作信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.acceptFriendApplication({ +OpenIMSDK.acceptFriendApplication({ toUserID: '', handleMsg: '', -}, 'operationID'); +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/addBlack.mdx b/docs/sdks/api/relation/addBlack.mdx index 9b752902e1..017dc9994b 100644 --- a/docs/sdks/api/relation/addBlack.mdx +++ b/docs/sdks/api/relation/addBlack.mdx @@ -232,10 +232,10 @@ IMSDK.asyncApi('addBlack', IMSDK.uuid(), { toUserID: 'userID' }) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.addBlack({ +OpenIMSDK.addBlack({ toUserID: string; ex?: string; -}, operationID: string): Promise; +}, operationID?: string): Promise; ``` ### 输入参数 @@ -244,27 +244,27 @@ OpenIMSDKRN.addBlack({ | ----------- | -------- | -------- | ------------------------------------------------------- | | userID | string | 是 | 用户 ID | | ex | string | 否 | 扩展字段 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.addBlack({ +OpenIMSDK.addBlack({ toUserID: 'userID', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/addFriend.mdx b/docs/sdks/api/relation/addFriend.mdx index 5de07e34ff..0cccb6c6fe 100644 --- a/docs/sdks/api/relation/addFriend.mdx +++ b/docs/sdks/api/relation/addFriend.mdx @@ -243,7 +243,7 @@ IMSDK.asyncApi('addFriend', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.addFriend({ +OpenIMSDK.addFriend({ toUserID: string; reqMsg: string; }, operationID?: string): Promise @@ -255,28 +255,28 @@ OpenIMSDKRN.addFriend({ | ----------- | -------- | -------- | ------------------------------------------------------- | | toUserID | string | 是 | 要添加的用户 ID | | reqMsg | string | 是 | 好友请求信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.addFriend({ +OpenIMSDK.addFriend({ toUserID: '', reqMsg: '', -}, 'operationID'); +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/checkFriend.mdx b/docs/sdks/api/relation/checkFriend.mdx index 96d531ca7d..223a5459e2 100644 --- a/docs/sdks/api/relation/checkFriend.mdx +++ b/docs/sdks/api/relation/checkFriend.mdx @@ -257,7 +257,7 @@ type FriendshipInfo = { result: number; // 1是好友 0非好友 userID: string; }; -OpenIMSDKRN.checkFriend(userIDList: string[], operationID: string): Promise +OpenIMSDK.checkFriend(userIDList: string[], operationID?: string): Promise ``` ### 输入参数 @@ -265,7 +265,7 @@ OpenIMSDKRN.checkFriend(userIDList: string[], operationID: string): Promise | 好友关系结果信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const userIDList = ['userID1', 'userID2']; -OpenIMSDKRN.checkFriend(userIDList, 'operationID') +OpenIMSDK.checkFriend(userIDList) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/deleteFriend.mdx b/docs/sdks/api/relation/deleteFriend.mdx index 19f0979fbf..0716af4d8b 100644 --- a/docs/sdks/api/relation/deleteFriend.mdx +++ b/docs/sdks/api/relation/deleteFriend.mdx @@ -224,7 +224,7 @@ IMSDK.asyncApi('deleteFriend', IMSDK.uuid(), 'userID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.deleteFriend(userID: string, operationID: string): Promise; +OpenIMSDK.deleteFriend(userID: string, operationID?: string): Promise; ``` ### 输入参数 @@ -232,25 +232,25 @@ OpenIMSDKRN.deleteFriend(userID: string, operationID: string): Promise; | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | userID | string | 是 | 用户 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.deleteFriend('userID', 'operationID') +OpenIMSDK.deleteFriend('userID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/getBlackList.mdx b/docs/sdks/api/relation/getBlackList.mdx index db5ccaac17..1d5d771943 100644 --- a/docs/sdks/api/relation/getBlackList.mdx +++ b/docs/sdks/api/relation/getBlackList.mdx @@ -204,32 +204,32 @@ IMSDK.asyncApi('getBlackList', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getBlackList(operationID: string): Promise +OpenIMSDK.getBlackList(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ----------------------------------------------------------------- | ------------------ | | Promise.then() | Promise<[BlackUserItem](docs/sdks/class/relation/blackInfo.mdx)[]\> | 黑名单信息对象列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getBlackList('operationID') +OpenIMSDK.getBlackList() .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/getFriendApplicationListAsApplicant.mdx b/docs/sdks/api/relation/getFriendApplicationListAsApplicant.mdx index fcce110f4c..e4d2ab28cf 100644 --- a/docs/sdks/api/relation/getFriendApplicationListAsApplicant.mdx +++ b/docs/sdks/api/relation/getFriendApplicationListAsApplicant.mdx @@ -220,32 +220,40 @@ IMSDK.asyncApi('getFriendApplicationListAsApplicant', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getFriendApplicationListAsApplicant(operationID: string): Promise +OpenIMSDK.getFriendApplicationListAsApplicant(req: { + offset: number; + count: number; +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| offset | number | 是 | 分页拉取起始下标 | +| count | number | 是 | 一页拉取的数量 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | --------------------------------------------------------------------------------- | ------------------ | | Promise.then() | Promise<[FriendApplicationItem](docs/sdks/class/relation/friendApplication.mdx)[]\> | 发出的好友请求列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getFriendApplicationListAsApplicant('operationID') +OpenIMSDK.getFriendApplicationListAsApplicant({ + offset: 0, + count: 10, +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/getFriendApplicationListAsRecipient.mdx b/docs/sdks/api/relation/getFriendApplicationListAsRecipient.mdx index 1abd5a13f6..15592e5ac3 100644 --- a/docs/sdks/api/relation/getFriendApplicationListAsRecipient.mdx +++ b/docs/sdks/api/relation/getFriendApplicationListAsRecipient.mdx @@ -220,32 +220,43 @@ IMSDK.asyncApi('getFriendApplicationListAsRecipient', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getFriendApplicationListAsRecipient(operationID: string): Promise +OpenIMSDK.getFriendApplicationListAsRecipient(req: { + offset: number; + count: number; + handleResults: number[] +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| offset | number | 是 | 分页拉取起始下标 | +| count | number | 是 | 一页拉取的数量 | +| handleResults | number[] | 是 | - | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | --------------------------------------------------------------------------------- | ------------------ | | Promise.then() | Promise<[FriendApplicationItem](docs/sdks/class/relation/friendApplication.mdx)[]\> | 收到的好友请求列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getFriendApplicationListAsRecipient('operationID') +OpenIMSDK.getFriendApplicationListAsRecipient({ + offset: 0, + count: 10, + handleResults: [], +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/getFriendList.mdx b/docs/sdks/api/relation/getFriendList.mdx index bc8f5ab89e..1295e01d8c 100644 --- a/docs/sdks/api/relation/getFriendList.mdx +++ b/docs/sdks/api/relation/getFriendList.mdx @@ -196,7 +196,7 @@ IMSDK.asyncApi('getFriendList', operationID: string, filterBlack: boolean): Prom | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------- | ---------------- | | Promise.then() | Promise<[FriendUserItem](docs/sdks/class/relation/friendInfo.mdx)[]\> | 好友信息对象列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 @@ -218,7 +218,7 @@ IMSDK.asyncApi('getFriendList', IMSDK.uuid(), false) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getFriendList(filterBlack: boolean, operationID: string): Promise +OpenIMSDK.getFriendList(filterBlack: boolean, operationID?: string): Promise ``` ### 输入参数 @@ -226,25 +226,25 @@ OpenIMSDKRN.getFriendList(filterBlack: boolean, operationID: string): Promise | 好友信息对象列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getFriendList(false, 'operationID') +OpenIMSDK.getFriendList(false) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/getFriendListPage.mdx b/docs/sdks/api/relation/getFriendListPage.mdx index a68834bc44..f48b97a417 100644 --- a/docs/sdks/api/relation/getFriendListPage.mdx +++ b/docs/sdks/api/relation/getFriendListPage.mdx @@ -254,11 +254,11 @@ IMSDK.asyncApi('getFriendListPage', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getFriendListPage({ +OpenIMSDK.getFriendListPage({ offset: number; count: number; filterBlack?: boolean; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -268,28 +268,28 @@ OpenIMSDKRN.getFriendListPage({ | offset | number | 是 | 分页拉取起始下标 | | count | number | 是 | 一页拉取的数量 | | filterBlack | boolean | 否 | 是否过滤掉黑名单 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------- | ---------------- | | Promise.then() | Promise\> | 好友信息对象列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getFriendListPage({ +OpenIMSDK.getFriendListPage({ offset, count, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/getSpecifiedFriendsInfo.mdx b/docs/sdks/api/relation/getSpecifiedFriendsInfo.mdx index a4888f4e97..6852477a59 100644 --- a/docs/sdks/api/relation/getSpecifiedFriendsInfo.mdx +++ b/docs/sdks/api/relation/getSpecifiedFriendsInfo.mdx @@ -239,10 +239,10 @@ IMSDK.asyncApi('getSpecifiedFriendsInfo', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getSpecifiedFriendsInfo({ +OpenIMSDK.getSpecifiedFriendsInfo({ friendUserIDList: string[]; filterBlack?: boolean; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -251,28 +251,28 @@ OpenIMSDKRN.getSpecifiedFriendsInfo({ | ---------- | -------- | -------- | ------------ | | friendUserIDList | string[] | 是 | 用户 ID 列表 | | filterBlack | boolean | 否 | 是否过滤掉黑名单 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------------------- | ------------ | | Promise.then() | Promise\> | 好友信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const userIDList = ['userID1', 'userID2']; -OpenIMSDKRN.getSpecifiedFriendsInfo({ +OpenIMSDK.getSpecifiedFriendsInfo({ friendUserIDList: userIDList -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/refuseFriendApplication.mdx b/docs/sdks/api/relation/refuseFriendApplication.mdx index 93252ff5c0..ad778e8805 100644 --- a/docs/sdks/api/relation/refuseFriendApplication.mdx +++ b/docs/sdks/api/relation/refuseFriendApplication.mdx @@ -246,10 +246,10 @@ IMSDK.asyncApi('refuseFriendApplication', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.refuseFriendApplication({ +OpenIMSDK.refuseFriendApplication({ toUserID: string; handleMsg: string; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -258,29 +258,29 @@ OpenIMSDKRN.refuseFriendApplication({ | --------- | -------- | -------- | ----------------- | | toUserID | string | 是 | 申请发起者用户 ID | | handleMsg | string | 是 | 操作信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.refuseFriendApplication({ +OpenIMSDK.refuseFriendApplication({ toUserID: '', handleMsg: '', -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/removeBlack.mdx b/docs/sdks/api/relation/removeBlack.mdx index c8eeeb4479..d0530d9905 100644 --- a/docs/sdks/api/relation/removeBlack.mdx +++ b/docs/sdks/api/relation/removeBlack.mdx @@ -225,7 +225,7 @@ IMSDK.asyncApi('removeBlack', IMSDK.uuid(), 'userID') ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.removeBlack(userID: string, operationID: string): Promise +OpenIMSDK.removeBlack(userID: string, operationID?: string): Promise ``` ### 输入参数 @@ -233,25 +233,25 @@ OpenIMSDKRN.removeBlack(userID: string, operationID: string): Promise | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | userID | string | 是 | 用户 ID | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.removeBlack('userID', 'operationID') +OpenIMSDK.removeBlack('userID') .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/searchFriends.mdx b/docs/sdks/api/relation/searchFriends.mdx index 0990c48430..7f47a19b44 100644 --- a/docs/sdks/api/relation/searchFriends.mdx +++ b/docs/sdks/api/relation/searchFriends.mdx @@ -326,12 +326,12 @@ enum Relationship { type SearchedFriendsInfo = FriendUserItem & { relationship: Relationship; }; -OpenIMSDKRN.searchFriends({ +OpenIMSDK.searchFriends({ keywordList: string[]; isSearchUserID: boolean; isSearchNickname: boolean; isSearchRemark: boolean; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -342,7 +342,7 @@ OpenIMSDKRN.searchFriends({ | isSearchUserID | boolean | 是 | 是否以关键词搜索 userID | | isSearchNickname | boolean | 是 | 是否以关键词搜索昵称 | | isSearchRemark | boolean | 是 | 是否以关键词搜索备注 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 @@ -350,23 +350,23 @@ OpenIMSDKRN.searchFriends({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | -------------------- | | Promise.then() | Promise | 搜索到的好友信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.searchFriends({ - keywordList: ['nickname']; +OpenIMSDK.searchFriends({ + keywordList: ['nickname'], isSearchUserID: false, isSearchNickname: true, isSearchRemark: true, -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/relation/updateFriends.mdx b/docs/sdks/api/relation/updateFriends.mdx index 97c3c8cb76..81a423748c 100644 --- a/docs/sdks/api/relation/updateFriends.mdx +++ b/docs/sdks/api/relation/updateFriends.mdx @@ -250,19 +250,19 @@ IMSDK.asyncApi('updateFriends', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.updateFriends({ +OpenIMSDK.updateFriends({ friendUserIDs: string[]; isPinned?: boolean; remark?: boolean; ex?: boolean; -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | | friendUserIDs | string[] | 是 | 好友 ID 列表 | | isPinned | boolean | 否 | 是否为星标好友 | | remark | string | 否 | 好友备注 | @@ -274,21 +274,21 @@ OpenIMSDKRN.updateFriends({ | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise<[WsResponse](docs/sdks/class/response.mdx)\> | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; -OpenIMSDKRN.updateFriends({ +OpenIMSDK.updateFriends({ friendUserIDs: ['userID'], remark: "new remark" -}, 'operationID') +}) .then((data) => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/third/logs.mdx b/docs/sdks/api/third/logs.mdx index fa91c9b967..fb6f9764dd 100644 --- a/docs/sdks/api/third/logs.mdx +++ b/docs/sdks/api/third/logs.mdx @@ -272,14 +272,14 @@ IMSDK.asyncApi('logs', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.logs({ +OpenIMSDK.logs({ logLevel: number, file: string, line: number, msgs: string, err: string, keyAndValue: string -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -292,36 +292,37 @@ OpenIMSDKRN.logs({ | msgs | string | 否 | 错误信息 | | err | string | 否 | 错误信息 | | keyAndValues | string | 否 | 参数 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ----------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.logs({ +OpenIMSDK.logs({ logLevel: 5, file: 'file', line: 10, msgs: 'msgs', err: 'err', keyAndValue: 'keyAndValue' -}, 'operationID') +}) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` + diff --git a/docs/sdks/api/third/setAppBadge.mdx b/docs/sdks/api/third/setAppBadge.mdx index 1c99a778b5..8973f212b2 100644 --- a/docs/sdks/api/third/setAppBadge.mdx +++ b/docs/sdks/api/third/setAppBadge.mdx @@ -157,7 +157,7 @@ IMSDK.asyncApi('setAppBadge', IMSDK.uuid(), 99) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setAppBadge(appUnreadCount: number, operationID: string): Promise +OpenIMSDK.setAppBadge(appUnreadCount: number, operationID?: string): Promise ``` ### 输入参数 @@ -165,25 +165,25 @@ OpenIMSDKRN.setAppBadge(appUnreadCount: number, operationID: string): Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.setAppBadge(99, 'operationID') +OpenIMSDK.setAppBadge(99) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/third/updateFcmToken.mdx b/docs/sdks/api/third/updateFcmToken.mdx index 97b27a718c..331ec31467 100644 --- a/docs/sdks/api/third/updateFcmToken.mdx +++ b/docs/sdks/api/third/updateFcmToken.mdx @@ -182,7 +182,7 @@ updateFcmToken(fcmToken, expireTime) .then(data => { // handle success }) - .catch(err => { + .catch((error) => { // handle failure }); ``` @@ -193,10 +193,8 @@ updateFcmToken(fcmToken, expireTime) ### Function Prototype -```javascript showLineNumbers -function updateFcmToken(fcmToken, expireTime) { - // implementation -} +```ts showLineNumbers +OpenIMSDK.updateFcmToken(fcmToken: string, expireTime: number, operationID?: string): Promise; ``` ### Input Parameters @@ -205,11 +203,14 @@ function updateFcmToken(fcmToken, expireTime) { | ----------------| ----------------------------| | fcmToken | FCM Token | | expireTime | FCM Token expiration time, in seconds | +| operationID | Operation ID, optional | ### Code Example -```javascript showLineNumbers -updateFcmToken(fcmToken, expireTime) +```ts showLineNumbers +import OpenIMSDK from "@openim/rn-client-sdk"; + +OpenIMSDK.updateFcmToken(fcmToken, expireTime) .then(data => { // handle success }) diff --git a/docs/sdks/api/third/uploadFile.mdx b/docs/sdks/api/third/uploadFile.mdx index e360da45c7..e72409aaff 100644 --- a/docs/sdks/api/third/uploadFile.mdx +++ b/docs/sdks/api/third/uploadFile.mdx @@ -316,12 +316,12 @@ IMSDK.asyncApi('uploadFile', IMSDK.uuid(), { ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.uploadFile({ +OpenIMSDK.uploadFile({ name: string; contentType: string; uuid: string; filepath: string; -}, operationID: string): Promise<{ url: string }> +}, operationID?: string): Promise<{ url: string }> ``` ### 输入参数 @@ -332,30 +332,30 @@ OpenIMSDKRN.uploadFile({ | contentType | string | 是 | 文件类型 | | uuid | string | 是 | 文件唯一 ID | | filepath | string | 是 | 文件绝对路径 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise<{url:string}\> | 文件远程链接 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.uploadFile({ +OpenIMSDK.uploadFile({ name: 'fileName.zip', contentType: 'zip', uuid: 'uuid', filepath: 'path://...', -}, 'operationID') +}) .then((data) => { // data: 文件远程链接 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/third/uploadLogs.mdx b/docs/sdks/api/third/uploadLogs.mdx index b61a0c8d67..7a16cd9342 100644 --- a/docs/sdks/api/third/uploadLogs.mdx +++ b/docs/sdks/api/third/uploadLogs.mdx @@ -232,10 +232,10 @@ IMSDK.asyncApi('uploadLogs', IMSDK.uuid(), { line: 10000, ex: "" }) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.uploadLogs({ +OpenIMSDK.uploadLogs({ line: number, ex: string, -}, operationID: string): Promise +}, operationID?: string): Promise ``` ### 输入参数 @@ -244,26 +244,26 @@ OpenIMSDKRN.uploadLogs({ | -------------- | -------- | -------- | ---------------- | | line | number | 是 | 从后往前上传的行数 | | | ex | string | 是 | 额外字段 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ----------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.uploadLogs({ line: 10000, ex: "" }, 'operationID') +OpenIMSDK.uploadLogs({ line: 10000, ex: "" }) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/user/getSelfUserInfo.mdx b/docs/sdks/api/user/getSelfUserInfo.mdx index 49e8135ae0..27945ca8a0 100644 --- a/docs/sdks/api/user/getSelfUserInfo.mdx +++ b/docs/sdks/api/user/getSelfUserInfo.mdx @@ -205,33 +205,32 @@ IMSDK.asyncApi('getSelfUserInfo', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getSelfUserInfo(operationID: string): Promise +OpenIMSDK.getSelfUserInfo(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ----------------------------------------------------------- | ------------ | | Promise.then() | Promise<[SelfUserInfo](docs/sdks/class/user/userInfo.mdx)\> | 个人信息对象 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | - +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getSelfUserInfo('operationID') +OpenIMSDK.getSelfUserInfo() .then((data) => { // data: 当前登录用户的个人信息 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/user/getSubscribeUsersStatus.mdx b/docs/sdks/api/user/getSubscribeUsersStatus.mdx index bb7dec9ab9..6717096dc5 100644 --- a/docs/sdks/api/user/getSubscribeUsersStatus.mdx +++ b/docs/sdks/api/user/getSubscribeUsersStatus.mdx @@ -224,32 +224,32 @@ IMSDK.asyncApi('getSubscribeUsersStatus', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getSubscribeUsersStatus(operationID: string): Promise +OpenIMSDK.getSubscribeUsersStatus(operationID?: string): Promise ``` ### 输入参数 | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------------- | -------------------- | | Promise.then() | Promise<[UserOnlineState](docs/sdks/class/user/userStatusInfo.mdx)[]\> | 用户在线状态详情列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.getSubscribeUsersStatus('operationID') +OpenIMSDK.getSubscribeUsersStatus() .then((data) => { // data: 已订阅的用户在线状态详情列表 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/user/getUsersInfo.mdx b/docs/sdks/api/user/getUsersInfo.mdx index 3846421af7..b1636da186 100644 --- a/docs/sdks/api/user/getUsersInfo.mdx +++ b/docs/sdks/api/user/getUsersInfo.mdx @@ -231,7 +231,7 @@ IMSDK.asyncApi('getUsersInfo', IMSDK.uuid(), userIDList) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.getUsersInfo(userIDList: string[], operationID: string): Promise +OpenIMSDK.getUsersInfo(userIDList: string[], operationID?: string): Promise ``` ### 输入参数 @@ -239,26 +239,26 @@ OpenIMSDKRN.getUsersInfo(userIDList: string[], operationID: string): Promise | 查询到的用户信息列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const userIDList = ['userID1', 'userID2']; -OpenIMSDKRN.getUsersInfo(userIDList, 'operationID') +OpenIMSDK.getUsersInfo(userIDList) .then((data) => { // data: 查询到的用户信息列表 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/user/setSelfInfo.mdx b/docs/sdks/api/user/setSelfInfo.mdx index 898d9e6174..9873034b11 100644 --- a/docs/sdks/api/user/setSelfInfo.mdx +++ b/docs/sdks/api/user/setSelfInfo.mdx @@ -261,9 +261,9 @@ IMSDK.asyncApi('setSelfInfo', IMSDK.uuid(), userInfo) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.setSelfInfo( - userInfo: Partial>, - operationID: string +OpenIMSDK.setSelfInfo( + userInfo: Partial, + operationID?: string ): Promise ``` @@ -271,20 +271,20 @@ OpenIMSDKRN.setSelfInfo( | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------------------------------------------------------------------------- | -------- | ------------------------------------------------------- | -| userInfo | Partial> | 是 | 个人信息 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| userInfo | Partial<[SelfUserInfo](docs/sdks/class/user/userInfo.mdx)> | 是 | 个人信息 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ------------------------------------------------------- | ------------ | | Promise.then() | Promise | 调用成功回调 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const userInfo = { nickname: '', // 要修改的昵称,选填 @@ -292,11 +292,11 @@ const userInfo = { ex: '', // 要修改的扩展字段内容,选填 }; -OpenIMSDKRN.setSelfInfo(userInfo, 'operationID'); +OpenIMSDK.setSelfInfo(userInfo) .then(() => { // 调用成功 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/user/subscribeUsersStatus.mdx b/docs/sdks/api/user/subscribeUsersStatus.mdx index 79531741f2..ea7aab831b 100644 --- a/docs/sdks/api/user/subscribeUsersStatus.mdx +++ b/docs/sdks/api/user/subscribeUsersStatus.mdx @@ -237,7 +237,7 @@ IMSDK.asyncApi('subscribeUsersStatus', IMSDK.uuid(), userIDList) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.subscribeUsersStatus(userIDList: string[], operationID: string): Promise +OpenIMSDK.subscribeUsersStatus(userIDList: string[], operationID?: string): Promise ``` ### 输入参数 @@ -245,26 +245,26 @@ OpenIMSDKRN.subscribeUsersStatus(userIDList: string[], operationID: string): Pro | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | userIDList | string[] | 是 | 用户 ID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------------- | -------------------- | | Promise.then() | Promise<[UserOnlineState](docs/sdks/class/user/userStatusInfo.mdx)[]\> | 用户在线状态详情列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; const userIDList = ['userID1', 'userID2']; -const data = await OpenIMSDKRN.subscribeUsersStatus(userIDList, 'operationID'); +OpenIMSDK.subscribeUsersStatus(userIDList) .then((data) => { // data: 用户在线状态详情列表 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/api/user/unsubscribeUsersStatus.mdx b/docs/sdks/api/user/unsubscribeUsersStatus.mdx index 9735a4fb65..daddcafccc 100644 --- a/docs/sdks/api/user/unsubscribeUsersStatus.mdx +++ b/docs/sdks/api/user/unsubscribeUsersStatus.mdx @@ -230,7 +230,7 @@ IMSDK.asyncApi('unsubscribeUsersStatus', IMSDK.uuid()) ### 函数原型 ```ts showLineNumbers -OpenIMSDKRN.unsubscribeUsersStatus(userIDList: string[], operationID: string): Promise +OpenIMSDK.unsubscribeUsersStatus(userIDList: string[], operationID?: string): Promise ``` ### 输入参数 @@ -238,25 +238,25 @@ OpenIMSDKRN.unsubscribeUsersStatus(userIDList: string[], operationID: string): P | 参数名称 | 参数类型 | 是否必填 | 描述 | | ----------- | -------- | -------- | ------------------------------------------------------- | | userIDList | string[] | 是 | 用户 ID 列表 | -| operationID | string | 是 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | +| operationID | string | 否 | 操作 ID,用于定位问题,保持唯一,建议用当前时间和随机数 | ### 返回结果 | 参数名称 | 参数类型 | 描述 | | --------------- | ---------------------------------------------------------------------- | -------------------- | | Promise.then() | Promise<[UserOnlineState](docs/sdks/class/user/userStatusInfo.mdx)[]\> | 用户在线状态详情列表 | -| Promise.catch() | Promise<[CatchResponse](docs/sdks/class/response.mdx)\> | 调用失败回调 | +| Promise.catch() | Promise<[OpenIMApiError](docs/sdks/class/response.mdx)\> | 调用失败回调 | ### 代码示例 ```js showLineNumbers -import OpenIMSDKRN from "open-im-sdk-rn"; +import OpenIMSDK from "@openim/rn-client-sdk"; -OpenIMSDKRN.unsubscribeUsersStatus(userIDList, 'operationID'); +OpenIMSDK.unsubscribeUsersStatus(userIDList) .then((data) => { // data: 用户在线状态详情列表 }) - .catch(({ errCode, errMsg }) => { + .catch((error) => { // 调用失败 }); ``` diff --git a/docs/sdks/class/init/config.mdx b/docs/sdks/class/init/config.mdx index c2441d8a75..c20e96a8c1 100644 --- a/docs/sdks/class/init/config.mdx +++ b/docs/sdks/class/init/config.mdx @@ -130,7 +130,8 @@ values={[ | wsAddr | string | 是 | IM ws 地址,一般为`ws://xxx:10001`或`wss://xxx/msg_gateway` | | dataDir | string | 是 | IM 客户端 DB 存放目录 | | logLevel | [LogLevel](/docs/sdks/enum/logLevel.mdx) | 否 | SDK 日志打印级别 | -| isLogStandardOutput | boolean | 否 | 是否将日志打印到控制台 | +| isLogStandardOutput | boolean | 否 | 是否将日志打印到控制台 | +| logFilePath | string | 否 | 本地保存日志文件路径 | diff --git a/docs/sdks/class/response.mdx b/docs/sdks/class/response.mdx index b650b477c1..6944fd018a 100644 --- a/docs/sdks/class/response.mdx +++ b/docs/sdks/class/response.mdx @@ -46,23 +46,34 @@ type CatchResponse = { -### CatchResponse +### OpenIMApiError ### 类型 ```ts -type CatchResponse = { - errCode: number; - errMsg: string; -}; +export class OpenIMApiError extends Error { + name: string = 'OpenIMApiError'; + code: number; + message: string; + operationID: string; + + constructor(code: number, message: string, operationID: string) { + super(message); + this.code = code; + this.message = message; + this.operationID = operationID; + } +} ``` ### 字段说明 | 字段名称 | 字段类型 | 描述 | -| -------- | -------- | ------------------------ | --- | -| errCode | number | 调用失败时的错误码 | -| errMsg | string | 调用失败时的错误描述信息 | | +| -------- | -------- | ------------------------ | +| name | string | 错误名称 | +| code | number | 调用失败时的错误码 | +| message | string | 调用失败时的错误描述信息 | | +| operationID | string | 调用时传入的 operationID | diff --git a/docs/sdks/quickstart/reactNative.mdx b/docs/sdks/quickstart/reactNative.mdx index 78208d9558..b42b152ff3 100644 --- a/docs/sdks/quickstart/reactNative.mdx +++ b/docs/sdks/quickstart/reactNative.mdx @@ -9,40 +9,68 @@ sidebar_position: 4 ## 注意事项 ❗️ -- `open-im-sdk-rn@3.5.1` 包含了重大的破坏性更新。如果您需要升级,请检查传入参数和返回数据。 +- 从 `v3.8.3-patch.10` 版本开始,包名从 `open-im-sdk-rn` 改为 `@openim/rn-client-sdk`。 -- 与其他SDK不同,`React Native SDK` **operationID** 不是可选的,而是必填的。(operationID 用于后端日志查询) +- 从 `v3.8.3-patch.10.2` 版本开始,`operationID` 参数是可选的(如果未提供,SDK 将自动生成一个),在之前的版本,这个参数是必填的,必须显式传递。(operationID 用于后端日志查询) + +- 从 `v3.8.3-patch.10.2` 版本开始,您可以使用 `OpenIMSDK.on()` 来监听事件,在之前的版本,您必须使用 `OpenIMEmitter` 对象。最新版本兼容两种方式,但推荐使用 `OpenIMSDK.on()`,因为它提供了更好的 TypeScript 类型提示。 + +- `v3.5.1` 包含了重大的破坏性更新。如果您需要升级,请检查传入参数和返回数据。 ## 集成步骤 ( React Native CLI ) ### 1. 添加依赖 ```sh -yarn add open-im-sdk-rn +yarn add @openim/rn-client-sdk ``` ### 2. 初始化 SDK ```ts -import OpenIMSDKRN from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; import RNFS from 'react-native-fs'; RNFS.mkdir(RNFS.DocumentDirectoryPath + '/tmp'); -OpenIMSDKRN.initSDK({ +OpenIMSDK.initSDK({ platformID: 2, // 1: ios, 2: android apiAddr: 'http://your-server-ip:10002', wsAddr: 'ws://your-server-ip:10001', dataDir: RNFS.DocumentDirectoryPath + '/tmp', + logFilePath: RNFS.DocumentDirectoryPath + '/tmp', logLevel: 5, isLogStandardOutput: true, -}, 'opid'); +}); ``` ### 3. 登录、设置监听 ```ts -import OpenIMSDKRN, { OpenIMEmitter } from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; + +OpenIMSDK.login({ + userID: 'IM user ID', + token: 'IM user token', +}); + +OpenIMSDK.on('onConnecting', () => { + console.log('onConnecting'); +}); + +OpenIMSDK.on('onConnectSuccess', () => { + console.log('onConnectSuccess'); +}); + +OpenIMSDK.on('onConnectFailed', ({ errCode, errMsg }) => { + console.log('onConnectFailed', errCode, errMsg); +}); +``` + +如果您使用的是 `v3.8.3-patch.10.2` 以前的版本,请使用以下代码: + +```ts +import OpenIMSDKRN, { OpenIMEmitter } from '@openim/rn-client-sdk'; OpenIMSDKRN.login({ userID: 'IM user ID', @@ -65,11 +93,36 @@ OpenIMEmitter.addListener('onConnectFailed', ({ errCode, errMsg }) => { ### 4. 收发消息 ```ts -import OpenIMSDKRN, { OpenIMEmitter } from 'open-im-sdk-rn'; -import type { MessageItem } from 'open-im-sdk-rn'; +import OpenIMSDK from '@openim/rn-client-sdk'; +import type { MessageItem } from '@openim/rn-client-sdk'; + +OpenIMSDK.on('onRecvNewMessages', (messages: MessageItem[]) => { + console.log('onRecvNewMessages', messages); +}); + +const message = await OpenIMSDK.createTextMessage('hello openim'); + +OpenIMSDK.sendMessage({ + recvID: 'recipient user ID', + groupID: '', + message, +}) + .then(() => { + // Message sent successfully ✉️ + }) + .catch(err => { + // Failed to send message ❌ + console.log(err); + }); +``` + +如果您使用的是 `v3.8.3-patch.10.2` 以前的版本,请使用以下代码: + +```ts +import OpenIMSDKRN, { OpenIMEmitter } from '@openim/rn-client-sdk'; -OpenIMEmitter.addListener('onRecvNewMessages', (data: MessageItem[]) => { - console.log('onRecvNewMessages', data); +OpenIMEmitter.addListener('onRecvNewMessages', (messages) => { + console.log('onRecvNewMessages', messages); }); const message = await OpenIMSDKRN.createTextMessage('hello openim', 'opid'); @@ -86,4 +139,4 @@ OpenIMSDKRN.sendMessage({ // Failed to send message ❌ console.log(err); }); -``` \ No newline at end of file +```