Skip to content

Commit 701cb33

Browse files
feat: release v3.8.3-patch.10.1 (#75)
1 parent 526087e commit 701cb33

File tree

6 files changed

+42
-7
lines changed

6 files changed

+42
-7
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# React Native Client SDK for OpenIM 👨‍💻💬
22

3+
> **📢 Important Notice:** Starting from version 3.8.3-patch.10, the package name has been changed from `open-im-sdk-rn` to `@openim/rn-client-sdk`. Please update your dependency installation and import statements.
4+
35
Use this SDK to add instant messaging capabilities to your application. By connecting to a self-hosted [OpenIM](https://www.openim.io) server, you can quickly integrate instant messaging capabilities into your app with just a few lines of code.
46

57
The iOS SDK core is implemented in [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core). Using [gomobile](https://github.com/golang/mobile), it can be compiled into an XCFramework for iOS integration. iOS interacts with the [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core) through JSON, and the SDK exposes a re-encapsulated API for easy usage. In terms of data storage, iOS utilizes the SQLite layer provided internally by the [OpenIM SDK Core](https://github.com/openimsdk/openim-sdk-core).
@@ -10,7 +12,7 @@ The React Native Client SDK use [NativeModule](https://reactnative.dev/docs/nati
1012

1113
## Tips 🔔
1214

13-
1. The [email protected] has contains ***significant disruptive updates***. If you need to upgrade, please check the incoming data and the returned data.
15+
1. The [email protected] has contains ***significant disruptive updates***. If you need to upgrade, please check the incoming data and the returned data. **Note: Package name has been changed to `@openim/rn-client-sdk` starting from version 3.8.3-patch.10.**
1416

1517
2. Unlike other SDKS, React Native SDK operationID is not optional, but required.
1618

@@ -25,7 +27,7 @@ For the SDK reference, see [https://doc.rentsoft.cn/sdks/quickstart/reactnative]
2527
### Adding Dependencies
2628

2729
```sh
28-
yarn add open-im-sdk-rn
30+
yarn add @openim/rn-client-sdk
2931
```
3032

3133
## Usage 🚀
@@ -35,7 +37,7 @@ The following examples demonstrate how to use the SDK. TypeScript is used, provi
3537
### Importing the SDK and init
3638

3739
```typescript
38-
import OpenIMSDKRN from 'open-im-sdk-rn';
40+
import OpenIMSDKRN from '@openim/rn-client-sdk';
3941
import RNFS from 'react-native-fs';
4042

4143
RNFS.mkdir(RNFS.DocumentDirectoryPath + '/tmp');
@@ -53,7 +55,7 @@ OpenIMSDKRN.initSDK({
5355
### Logging In and Listening for Connection Status
5456

5557
```typescript
56-
import OpenIMSDKRN, { OpenIMEmitter } from 'open-im-sdk-rn';
58+
import OpenIMSDKRN, { OpenIMEmitter } from '@openim/rn-client-sdk';
5759

5860
OpenIMSDKRN.login({
5961
userID: 'IM user ID',
@@ -80,8 +82,8 @@ To log into the IM server, you need to create an account and obtain a user ID an
8082
OpenIM makes it easy to send and receive messages. By default, there is no restriction on having a friend relationship to send messages (although you can configure other policies on the server). If you know the user ID of the recipient, you can conveniently send a message to them.
8183

8284
```typescript
83-
import OpenIMSDKRN, { OpenIMEmitter } from 'open-im-sdk-rn';
84-
import type { MessageItem } from 'open-im-sdk-rn';
85+
import OpenIMSDKRN, { OpenIMEmitter } from '@openim/rn-client-sdk';
86+
import type { MessageItem } from '@openim/rn-client-sdk';
8587

8688
OpenIMEmitter.addListener('onRecvNewMessages', (data: MessageItem[]) => {
8789
console.log('onRecvNewMessages', data);

android/src/main/java/com/openimsdkrn/OpenImSdkRnModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,11 @@ public void getFriendApplicationListAsApplicant(String operationID, ReadableMap
807807
Open_im_sdk.getFriendApplicationListAsApplicant(new BaseImpl(promise), operationID, map2string(req));
808808
}
809809

810+
@ReactMethod
811+
public void getFriendApplicationUnhandledCount(ReadableMap req, String operationID, Promise promise) {
812+
Open_im_sdk.getFriendApplicationUnhandledCount(new BaseImpl(promise), operationID, map2string(req));
813+
}
814+
810815
@ReactMethod
811816
public void acceptFriendApplication(ReadableMap userIDHandleMsg, String operationID, Promise promise) {
812817
Open_im_sdk.acceptFriendApplication(new BaseImpl(promise), operationID, map2string(userIDHandleMsg));
@@ -989,6 +994,11 @@ public void getGroupApplicationListAsApplicant(String operationID, ReadableMap r
989994
Open_im_sdk.getGroupApplicationListAsApplicant(new BaseImpl(promise), operationID, map2string(req));
990995
}
991996

997+
@ReactMethod
998+
public void getGroupApplicationUnhandledCount(ReadableMap req, String operationID, Promise promise) {
999+
Open_im_sdk.getGroupApplicationUnhandledCount(new BaseImpl(promise), operationID, map2string(req));
1000+
}
1001+
9921002
@ReactMethod
9931003
public void acceptGroupApplication(ReadableMap options, String operationID, Promise promise) {
9941004
Open_im_sdk.acceptGroupApplication(new BaseImpl(promise), operationID, options.getString("groupID"),

ios/OpenImSdkRn.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,11 @@ - (NSArray *)parseJsonStr2Array:(NSString *)jsonStr {
910910
Open_im_sdkGetFriendApplicationListAsApplicant(proxy, operationID, [req json]);
911911
}
912912

913+
RCT_EXPORT_METHOD(getFriendApplicationUnhandledCount:(NSDictionary *)req operationID:(NSString *)operationID resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter) {
914+
RNCallbackProxy *proxy = [[RNCallbackProxy alloc] initWithCallback:resolver rejecter:rejecter];
915+
Open_im_sdkGetFriendApplicationUnhandledCount(proxy, operationID, [req json]);
916+
}
917+
913918
RCT_EXPORT_METHOD(acceptFriendApplication:(NSDictionary *)userIDHandleMsg operationID:(NSString *)operationID resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter) {
914919
RNCallbackProxy *proxy = [[RNCallbackProxy alloc] initWithCallback:resolver rejecter:rejecter];
915920
NSString *userIDHandleMsgJson = [userIDHandleMsg json];
@@ -1156,6 +1161,11 @@ - (NSArray *)parseJsonStr2Array:(NSString *)jsonStr {
11561161
Open_im_sdkGetGroupApplicationListAsApplicant(proxy, operationID, [req json]);
11571162
}
11581163

1164+
RCT_EXPORT_METHOD(getGroupApplicationUnhandledCount:(NSDictionary *)req operationID:(NSString *)operationID resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter) {
1165+
RNCallbackProxy *proxy = [[RNCallbackProxy alloc] initWithCallback:resolver rejecter:rejecter];
1166+
Open_im_sdkGetGroupApplicationUnhandledCount(proxy, operationID, [req json]);
1167+
}
1168+
11591169
RCT_EXPORT_METHOD(acceptGroupApplication:(NSDictionary *)options operationID:(NSString *)operationID resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter) {
11601170
RNCallbackProxy *proxy = [[RNCallbackProxy alloc] initWithCallback:resolver rejecter:rejecter];
11611171
NSString *groupID = options[@"groupID"];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openim/rn-client-sdk",
3-
"version": "3.8.3-patch.10",
3+
"version": "3.8.3-patch.10.1",
44
"description": "OpenIM SDK for react-native",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
GetGroupMembersInfoParams,
4444
GetInputStatesParams,
4545
GetOneConversationParams,
46+
GetSelfApplicationUnhandledCountParams,
4647
GetSpecifiedFriendsParams,
4748
ImageMsgParams,
4849
InitOptions,
@@ -175,6 +176,10 @@ interface OpenIMSDKRNInterface {
175176
operationID: string,
176177
req: GetFriendApplicationListAsRecipientParams
177178
) => Promise<FriendApplicationItem[]>;
179+
getFriendApplicationUnhandledCount: (
180+
req: GetSelfApplicationUnhandledCountParams,
181+
operationID: string
182+
) => Promise<number>;
178183
getFriendList: (
179184
filterBlack: boolean,
180185
operationID: string
@@ -240,6 +245,10 @@ interface OpenIMSDKRNInterface {
240245
operationID: string,
241246
req: GetGroupApplicationListAsApplicantParams
242247
) => Promise<GroupApplicationItem[]>;
248+
getGroupApplicationUnhandledCount: (
249+
req: GetSelfApplicationUnhandledCountParams,
250+
operationID: string
251+
) => Promise<number>;
243252
acceptGroupApplication: (
244253
params: AccessGroupParams,
245254
operationID: string

src/types/params.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ export type GetFriendApplicationListAsRecipientParams = {
123123
count: number;
124124
}
125125

126+
export type GetSelfApplicationUnhandledCountParams = {
127+
time: number;
128+
}
129+
126130
export type GetFriendApplicationListAsApplicantParams = {
127131
offset: number;
128132
count: number;

0 commit comments

Comments
 (0)