Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add batch msg listener #49

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/src/main/java/com/openimsdkrn/SendMsgCallBack.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void onError(int ErrCode, String ErrString) {
public void onProgress(long progress) {
WritableMap params = Arguments.createMap();
params.putInt("progress", (int) progress);
params.putMap("message", message);
params.putMap("message", Arguments.makeNativeMap(message.toHashMap()));
send(ctx, "SendMessageProgress", params);
}

Expand Down
2 changes: 1 addition & 1 deletion ios/OpenImSdkRn.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import <React/RCTEventEmitter.h>
#endif

@interface OpenIMSDKRN : RCTEventEmitter <RCTBridgeModule,Open_im_sdk_callbackOnConnListener,Open_im_sdk_callbackOnUserListener, Open_im_sdk_callbackOnAdvancedMsgListener, Open_im_sdk_callbackOnFriendshipListener, Open_im_sdk_callbackOnConversationListener, Open_im_sdk_callbackOnGroupListener>
@interface OpenIMSDKRN : RCTEventEmitter <RCTBridgeModule,Open_im_sdk_callbackOnConnListener,Open_im_sdk_callbackOnUserListener, Open_im_sdk_callbackOnAdvancedMsgListener, Open_im_sdk_callbackOnFriendshipListener, Open_im_sdk_callbackOnConversationListener, Open_im_sdk_callbackOnGroupListener, Open_im_sdk_callbackOnBatchMsgListener>

- (void)pushEvent:(NSString *) eventName data:(id) data;

Expand Down
5 changes: 5 additions & 0 deletions ios/OpenImSdkRn.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,18 @@ - (NSArray *)parseJsonStr2Array:(NSString *)jsonStr {
Open_im_sdkSetFriendListener(self);
Open_im_sdkSetGroupListener(self);
Open_im_sdkSetAdvancedMsgListener(self);
Open_im_sdkSetBatchMsgListener(self);
if (flag) {
resolve(@"init success");
}else{
reject(@"-1",@"please check params and dir",nil);
}
}

RCT_EXPORT_METHOD(setBatchMsgListener) {
Open_im_sdkSetBatchMsgListener(self);
}

RCT_EXPORT_METHOD(setUserListener) {
Open_im_sdkSetUserListener(self);
}
Expand Down