juggleim-rnsdk 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build/.transforms/42b8ab7e96b9440b0e91d2ecba5f579c/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/call/JuggleIMCallModule$3.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/call/JuggleIMCallModule.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/call/JuggleIMCallModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/call/JuggleIMCallModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/call/JuggleIMCallModule$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/call/JuggleIMCallModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMCallModule$1.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMCallModule$2.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMCallModule$3.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMCallModule.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/juggleim/call/JuggleIMCallModule.java +17 -0
- package/ios/JModelFactory.m +63 -0
- package/ios/JuggleIMManager.m +6 -0
- package/ios/call/JuggleIMCallModule.m +16 -0
- package/juggleim-rnsdk.podspec +1 -1
- package/package.json +1 -1
- package/src/call/CallSession.ts +14 -0
- package/src/types.d.ts +13 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$1.class.uniqueId31 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$10.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$11.class.uniqueId18 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$12.class.uniqueId28 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$13.class.uniqueId9 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$14.class.uniqueId20 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$15.class.uniqueId8 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$16.class.uniqueId14 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$17.class.uniqueId30 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$18.class.uniqueId11 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$19.class.uniqueId26 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$2.class.uniqueId4 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$20.class.uniqueId7 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$21.class.uniqueId17 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$22.class.uniqueId24 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$23.class.uniqueId13 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$24.class.uniqueId19 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$25.class.uniqueId5 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$26.class.uniqueId16 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$27.class.uniqueId29 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$28.class.uniqueId10 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$29.class.uniqueId23 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$3.class.uniqueId22 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$30.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$4.class.uniqueId27 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$5.class.uniqueId12 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$6.class.uniqueId15 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$7.class.uniqueId6 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$8.class.uniqueId21 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$9.class.uniqueId25 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager.class.uniqueId2 +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMPackage.class.uniqueId3 → JuggleIMPackage.class.uniqueId4} +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Wed Jan 21 11:43:06 CST 2026
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -44,7 +44,7 @@ repositories {
|
|
|
44
44
|
|
|
45
45
|
dependencies {
|
|
46
46
|
implementation 'com.facebook.react:react-native:0.71.1'
|
|
47
|
-
implementation 'com.juggle.im:juggle:1.8.
|
|
47
|
+
implementation 'com.juggle.im:juggle:1.8.37'
|
|
48
48
|
implementation 'com.juggle.call.zego:juggle:1.8.25'
|
|
49
49
|
implementation 'im.zego:express-video:3.17.3'
|
|
50
50
|
}
|
|
@@ -308,6 +308,23 @@ public class JuggleIMCallModule extends ReactContextBaseJavaModule {
|
|
|
308
308
|
promise.resolve(null);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
/**
|
|
312
|
+
* 停止预览
|
|
313
|
+
* 用于被叫方在接听前挂断时停止预览
|
|
314
|
+
* @param callId 会话ID
|
|
315
|
+
* @param promise Promise
|
|
316
|
+
*/
|
|
317
|
+
@ReactMethod
|
|
318
|
+
public void stopPreview(String callId, Promise promise) {
|
|
319
|
+
ICallSession session = getCallManager().getCallSession(callId);
|
|
320
|
+
if (session == null) {
|
|
321
|
+
promise.resolve(null);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
session.stopPreview();
|
|
325
|
+
promise.resolve(null);
|
|
326
|
+
}
|
|
327
|
+
|
|
311
328
|
@ReactMethod
|
|
312
329
|
public void addSessionListener(String callId, String key) {
|
|
313
330
|
ICallSession session = getCallManager().getCallSession(callId);
|
package/ios/JModelFactory.m
CHANGED
|
@@ -677,6 +677,8 @@
|
|
|
677
677
|
content = [self voiceMessageFromData:data];
|
|
678
678
|
} else if ([contentType isEqualToString:@"jg:merge"]) {
|
|
679
679
|
content = [self mergeMessageFromData:data];
|
|
680
|
+
} else if ([contentType isEqualToString:@"jg:callfinishntf"]) {
|
|
681
|
+
content = [self callFinishNotifyMessageFromString:string];
|
|
680
682
|
} else {
|
|
681
683
|
content = [self unknownMessageFromString:string type:contentType];
|
|
682
684
|
}
|
|
@@ -750,6 +752,67 @@
|
|
|
750
752
|
return unknown;
|
|
751
753
|
}
|
|
752
754
|
|
|
755
|
+
/**
|
|
756
|
+
* 解析通话结束通知消息
|
|
757
|
+
* 原生字段: reason, duration, mMediaType
|
|
758
|
+
* RN层字段: finishType, duration, mediaType
|
|
759
|
+
*/
|
|
760
|
+
+ (JUnknownMessage *)callFinishNotifyMessageFromString:(NSString *)string {
|
|
761
|
+
// 解析 JSON 字符串
|
|
762
|
+
NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
|
|
763
|
+
if (!data) {
|
|
764
|
+
return [self unknownMessageFromString:string type:@"jg:callfinishntf"];
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
NSError *error = nil;
|
|
768
|
+
NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:data
|
|
769
|
+
options:0
|
|
770
|
+
error:&error];
|
|
771
|
+
if (error || ![jsonDict isKindOfClass:[NSDictionary class]]) {
|
|
772
|
+
return [self unknownMessageFromString:string type:@"jg:callfinishntf"];
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// 字段映射: reason -> finishType, mMediaType -> mediaType
|
|
776
|
+
NSMutableDictionary *mappedDict = [NSMutableDictionary dictionary];
|
|
777
|
+
|
|
778
|
+
// 映射 finishType (from reason)
|
|
779
|
+
if (jsonDict[@"reason"]) {
|
|
780
|
+
id reason = jsonDict[@"reason"];
|
|
781
|
+
if ([reason isKindOfClass:[NSString class]]) {
|
|
782
|
+
// 尝试将字符串转换为数字
|
|
783
|
+
NSNumber *finishTypeNum = @([reason integerValue]);
|
|
784
|
+
mappedDict[@"finishType"] = finishTypeNum;
|
|
785
|
+
} else if ([reason isKindOfClass:[NSNumber class]]) {
|
|
786
|
+
mappedDict[@"finishType"] = reason;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
// 映射 duration (保持不变)
|
|
791
|
+
if (jsonDict[@"duration"]) {
|
|
792
|
+
mappedDict[@"duration"] = jsonDict[@"duration"];
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
// 映射 mediaType (from mMediaType)
|
|
796
|
+
if (jsonDict[@"mMediaType"]) {
|
|
797
|
+
mappedDict[@"mediaType"] = jsonDict[@"mMediaType"];
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// 将映射后的字典转换回 JSON 字符串
|
|
801
|
+
NSData *mappedData = [NSJSONSerialization dataWithJSONObject:mappedDict
|
|
802
|
+
options:0
|
|
803
|
+
error:&error];
|
|
804
|
+
if (error || !mappedData) {
|
|
805
|
+
return [self unknownMessageFromString:string type:@"jg:callfinishntf"];
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
NSString *mappedString = [[NSString alloc] initWithData:mappedData encoding:NSUTF8StringEncoding];
|
|
809
|
+
|
|
810
|
+
JUnknownMessage *unknown = [JUnknownMessage new];
|
|
811
|
+
unknown.content = mappedString;
|
|
812
|
+
unknown.messageType = @"jg:callfinishntf";
|
|
813
|
+
return unknown;
|
|
814
|
+
}
|
|
815
|
+
|
|
753
816
|
#pragma mark - extension
|
|
754
817
|
+ (void)extendDic:(NSMutableDictionary *)dic
|
|
755
818
|
forConversationInfo:(JConversationInfo *)info {
|
package/ios/JuggleIMManager.m
CHANGED
|
@@ -485,6 +485,11 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
485
485
|
dict[@"previewList"] = mergeMsg.previewList;
|
|
486
486
|
dict[@"containerMsgId"] = mergeMsg.containerMsgId;
|
|
487
487
|
dict[@"extra"] = mergeMsg.extra ?: @"";
|
|
488
|
+
} else if ([contentType isEqualToString:@"jg:callfinishntf"]) {
|
|
489
|
+
JCallFinishNotifyMessage *callFinishMsg = (JCallFinishNotifyMessage *)content;
|
|
490
|
+
dict[@"reason"] = @(callFinishMsg.finishType);
|
|
491
|
+
dict[@"duration"] = @(callFinishMsg.duration);
|
|
492
|
+
dict[@"mediaType"] = @(callFinishMsg.mediaType);
|
|
488
493
|
} else if (self.customMessageTypes[contentType]) {
|
|
489
494
|
// 处理自定义消息:解析 JSON 数据
|
|
490
495
|
JUnknownMessage *customMsg = (JUnknownMessage *)content;
|
|
@@ -1724,6 +1729,7 @@ RCT_EXPORT_METHOD(sendMediaMessage : (NSDictionary *)messageDict resolver : (
|
|
|
1724
1729
|
[userArray addObject:userInfo];
|
|
1725
1730
|
}
|
|
1726
1731
|
}
|
|
1732
|
+
mentionInfo.targetUsers = userArray;
|
|
1727
1733
|
}
|
|
1728
1734
|
|
|
1729
1735
|
return mentionInfo;
|
|
@@ -331,6 +331,22 @@ RCT_EXPORT_METHOD(startPreview : (NSString *)callId viewTag : (
|
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
+
/**
|
|
335
|
+
* 停止预览
|
|
336
|
+
* 用于被叫方在接听前挂断时停止预览
|
|
337
|
+
* @param callId 会话ID
|
|
338
|
+
*/
|
|
339
|
+
RCT_EXPORT_METHOD(stopPreview : (NSString *)callId resolver : (
|
|
340
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
341
|
+
id<JCallSession> session = [[self getCallManager] getCallSession:callId];
|
|
342
|
+
if (!session) {
|
|
343
|
+
resolve(nil);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
[session stopPreview];
|
|
347
|
+
resolve(nil);
|
|
348
|
+
}
|
|
349
|
+
|
|
334
350
|
#pragma mark - Session Listeners
|
|
335
351
|
|
|
336
352
|
RCT_EXPORT_METHOD(addSessionListener : (NSString *)callId key : (NSString *)
|
package/juggleim-rnsdk.podspec
CHANGED
package/package.json
CHANGED
package/src/call/CallSession.ts
CHANGED
|
@@ -183,4 +183,18 @@ export class CallSession {
|
|
|
183
183
|
|
|
184
184
|
return JuggleIMCallModule.startPreview(this.callId, view);
|
|
185
185
|
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 停止预览
|
|
189
|
+
* 用于被叫方在接听前挂断时停止预览。
|
|
190
|
+
* 如果接听后,则不需要停止预览(由通话结束自动处理)。
|
|
191
|
+
*
|
|
192
|
+
* 使用场景:
|
|
193
|
+
* - 作为被叫方,被呼叫后开启了预览,之后直接挂断,需要停止预览
|
|
194
|
+
* - 如果接听了通话,则不需要调用此方法(通话结束会自动停止)
|
|
195
|
+
*/
|
|
196
|
+
stopPreview(): Promise<void> {
|
|
197
|
+
console.log('stopPreview', this.callId);
|
|
198
|
+
return JuggleIMCallModule.stopPreview(this.callId);
|
|
199
|
+
}
|
|
186
200
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -178,6 +178,19 @@ export class VoiceMessageContent extends MessageContent {
|
|
|
178
178
|
contentType: string;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* 通话结束通知消息内容: jg:callfinishntf
|
|
183
|
+
* @property {number} finishType - 结束类型(从原生 reason 字段映射)
|
|
184
|
+
* @property {number} duration - 通话时长,单位秒
|
|
185
|
+
* @property {number} mediaType - 媒体类型: 0-语音, 1-视频
|
|
186
|
+
*/
|
|
187
|
+
export class CallFinishNotifyMessageContent extends MessageContent {
|
|
188
|
+
contentType: string;
|
|
189
|
+
finishType?: number;
|
|
190
|
+
duration?: number;
|
|
191
|
+
mediaType?: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
181
194
|
|
|
182
195
|
/**
|
|
183
196
|
* 消息对象
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|