juggleim-rnsdk 0.1.13 → 0.2.1
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/JuggleIMManager$1.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$10.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$11.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$12.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$13.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$14.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$15.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$16.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$17.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$18.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$19.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$2.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$20.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$21.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$22.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$23.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$24.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$25.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$26.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$27.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$3.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$4.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$5.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$6.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$7.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$8.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$9.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.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/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$10.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$11.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$12.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$13.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$14.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$15.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$16.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$17.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$18.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$19.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$20.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$21.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$22.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$23.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$24.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$25.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$26.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$27.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$7.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$8.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$9.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$10.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$11.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$12.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$13.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$14.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$15.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$16.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$17.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$18.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$19.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$20.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$21.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$22.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$23.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$24.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$25.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$26.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$27.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$7.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$8.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$9.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager.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/JuggleIMManager$1.class.uniqueId25 +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.uniqueId14 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$12.class.uniqueId23 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$13.class.uniqueId7 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$14.class.uniqueId16 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$15.class.uniqueId6 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$16.class.uniqueId11 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$17.class.uniqueId24 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$18.class.uniqueId8 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$19.class.uniqueId21 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$2.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$20.class.uniqueId5 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$21.class.uniqueId13 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$22.class.uniqueId19 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$23.class.uniqueId10 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$24.class.uniqueId15 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$3.class.uniqueId18 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$4.class.uniqueId22 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$5.class.uniqueId9 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$6.class.uniqueId12 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$7.class.uniqueId4 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$8.class.uniqueId17 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$9.class.uniqueId20 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager.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/JuggleIMManager.java +331 -2
- package/ios/JuggleIMManager.m +251 -12
- package/juggleim-rnsdk.podspec +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +62 -1
- package/src/index.js +234 -22
- package/src/types.d.ts +93 -1
package/ios/JuggleIMManager.m
CHANGED
|
@@ -476,6 +476,14 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
476
476
|
dict[@"localPath"] = voiceMsg.localPath ?: @"";
|
|
477
477
|
dict[@"duration"] = @(voiceMsg.duration);
|
|
478
478
|
dict[@"extra"] = voiceMsg.extra ?: @"";
|
|
479
|
+
} else if ([content isKindOfClass:[JMergeMessage class]]) {
|
|
480
|
+
JMergeMessage *mergeMsg = (JMergeMessage *)content;
|
|
481
|
+
dict[@"title"] = mergeMsg.title ?: @"";
|
|
482
|
+
dict[@"conversation"] = mergeMsg.conversation;
|
|
483
|
+
dict[@"messageIdList"] = mergeMsg.messageIdList;
|
|
484
|
+
dict[@"previewList"] = mergeMsg.previewList;
|
|
485
|
+
dict[@"containerMsgId"] = mergeMsg.containerMsgId;
|
|
486
|
+
dict[@"extra"] = mergeMsg.extra ?: @"";
|
|
479
487
|
} else if (self.customMessageTypes[contentType]) {
|
|
480
488
|
// 处理自定义消息:解析 JSON 数据
|
|
481
489
|
JUnknownMessage *customMsg = (JUnknownMessage *)content;
|
|
@@ -532,8 +540,37 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
532
540
|
- (NSDictionary *)convertUserInfoToDictionary:(JUserInfo *)userInfo {
|
|
533
541
|
return @{
|
|
534
542
|
@"userId" : userInfo.userId ?: @"",
|
|
535
|
-
@"
|
|
536
|
-
@"avatar" : userInfo.portrait ?: @""
|
|
543
|
+
@"nickname" : userInfo.userName ?: @"",
|
|
544
|
+
@"avatar" : userInfo.portrait ?: @"",
|
|
545
|
+
@"extra" : userInfo.extraDic ?: @{},
|
|
546
|
+
@"type" : @(userInfo.type),
|
|
547
|
+
@"updatedTime" : @(userInfo.updatedTime)
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* 将群组信息转换为字典
|
|
553
|
+
*/
|
|
554
|
+
- (NSDictionary *)convertGroupInfoToDictionary:(JGroupInfo *)groupInfo {
|
|
555
|
+
return @{
|
|
556
|
+
@"groupId" : groupInfo.groupId ?: @"",
|
|
557
|
+
@"groupName" : groupInfo.groupName ?: @"",
|
|
558
|
+
@"portrait" : groupInfo.portrait ?: @"",
|
|
559
|
+
@"extra" : groupInfo.extraDic ?: @{},
|
|
560
|
+
@"updatedTime" : @(groupInfo.updatedTime)
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* 将群成员信息转换为字典
|
|
566
|
+
*/
|
|
567
|
+
- (NSDictionary *)convertGroupMemberToDictionary:(JGroupMember *)groupMember {
|
|
568
|
+
return @{
|
|
569
|
+
@"groupId" : groupMember.groupId ?: @"",
|
|
570
|
+
@"userId" : groupMember.userId ?: @"",
|
|
571
|
+
@"groupDisplayName" : groupMember.groupDisplayName ?: @"",
|
|
572
|
+
@"extra" : groupMember.extraDic ?: @{},
|
|
573
|
+
@"updatedTime" : @(groupMember.updatedTime)
|
|
537
574
|
};
|
|
538
575
|
}
|
|
539
576
|
|
|
@@ -652,6 +689,38 @@ RCT_EXPORT_METHOD(getConversationInfo : (NSDictionary *)
|
|
|
652
689
|
}
|
|
653
690
|
}
|
|
654
691
|
|
|
692
|
+
RCT_EXPORT_METHOD(getUserInfo : (NSString *)userId resolver : (
|
|
693
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
694
|
+
JUserInfo *userInfo = [JIM.shared.userInfoManager getUserInfo:userId];
|
|
695
|
+
if (userInfo) {
|
|
696
|
+
resolve([self convertUserInfoToDictionary:userInfo]);
|
|
697
|
+
} else {
|
|
698
|
+
resolve([NSNull null]);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
RCT_EXPORT_METHOD(getGroupInfo : (NSString *)groupId resolver : (
|
|
703
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
704
|
+
JGroupInfo *groupInfo = [JIM.shared.userInfoManager getGroupInfo:groupId];
|
|
705
|
+
if (groupInfo) {
|
|
706
|
+
resolve([self convertGroupInfoToDictionary:groupInfo]);
|
|
707
|
+
} else {
|
|
708
|
+
resolve([NSNull null]);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
RCT_EXPORT_METHOD(getGroupMember : (NSString *)groupId userId : (NSString *)
|
|
713
|
+
userId resolver : (RCTPromiseResolveBlock)
|
|
714
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
715
|
+
JGroupMember *groupMember =
|
|
716
|
+
[JIM.shared.userInfoManager getGroupMember:groupId userId:userId];
|
|
717
|
+
if (groupMember) {
|
|
718
|
+
resolve([self convertGroupMemberToDictionary:groupMember]);
|
|
719
|
+
} else {
|
|
720
|
+
resolve([NSNull null]);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
655
724
|
/**
|
|
656
725
|
* 上传图片
|
|
657
726
|
*/
|
|
@@ -845,12 +914,12 @@ RCT_EXPORT_METHOD(setUnread : (NSDictionary *)conversationMap resolver : (
|
|
|
845
914
|
/**
|
|
846
915
|
* 获取置顶会话列表
|
|
847
916
|
*/
|
|
848
|
-
RCT_EXPORT_METHOD(getTopConversationInfoList:(int)count
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
917
|
+
RCT_EXPORT_METHOD(getTopConversationInfoList : (int)count timestamp : (double)
|
|
918
|
+
timestamp pullDirection : (int)pullDirection resolver : (
|
|
919
|
+
RCTPromiseResolveBlock)
|
|
920
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
921
|
+
JPullDirection direction =
|
|
922
|
+
pullDirection == 0 ? JPullDirectionNewer : JPullDirectionOlder;
|
|
854
923
|
|
|
855
924
|
NSArray<JConversationInfo *> *conversationInfos =
|
|
856
925
|
[JIM.shared.conversationManager
|
|
@@ -952,8 +1021,10 @@ RCT_EXPORT_METHOD(sendMessage : (NSDictionary *)messageDict messageId : (
|
|
|
952
1021
|
return;
|
|
953
1022
|
}
|
|
954
1023
|
|
|
1024
|
+
JMessageOptions *options = [self getOptionsFromDictionary:messageDict];
|
|
955
1025
|
// 发送消息
|
|
956
1026
|
JMessage *message = [JIM.shared.messageManager sendMessage:msg.content
|
|
1027
|
+
messageOption:options
|
|
957
1028
|
inConversation:msg.conversation
|
|
958
1029
|
success:^(JMessage *message) {
|
|
959
1030
|
[self sendEventWithName:@"onMessageSent"
|
|
@@ -1011,7 +1082,9 @@ RCT_EXPORT_METHOD(sendImageMessage : (NSDictionary *)messageDict messageId : (
|
|
|
1011
1082
|
imageMessage.height = [contentDict[@"height"] integerValue];
|
|
1012
1083
|
}
|
|
1013
1084
|
|
|
1085
|
+
JMessageOptions *options = [self getOptionsFromDictionary:messageDict];
|
|
1014
1086
|
JMessage *message = [JIM.shared.messageManager sendMediaMessage:imageMessage
|
|
1087
|
+
messageOption:options
|
|
1015
1088
|
inConversation:conversation
|
|
1016
1089
|
progress:^(int progress, JMessage *_Nonnull message) {
|
|
1017
1090
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
@@ -1076,7 +1149,9 @@ RCT_EXPORT_METHOD(sendFileMessage : (NSDictionary *)messageDict messageId : (
|
|
|
1076
1149
|
fileMessage.type = contentDict[@"type"];
|
|
1077
1150
|
}
|
|
1078
1151
|
|
|
1152
|
+
JMessageOptions *options = [self getOptionsFromDictionary:messageDict];
|
|
1079
1153
|
JMessage *message = [JIM.shared.messageManager sendMediaMessage:fileMessage
|
|
1154
|
+
messageOption:options
|
|
1080
1155
|
inConversation:conversation
|
|
1081
1156
|
progress:^(int progress, JMessage *_Nonnull message) {
|
|
1082
1157
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
@@ -1135,7 +1210,9 @@ RCT_EXPORT_METHOD(sendVoiceMessage : (NSDictionary *)messageDict messageId : (
|
|
|
1135
1210
|
voiceMessage.duration = [contentDict[@"duration"] integerValue];
|
|
1136
1211
|
}
|
|
1137
1212
|
|
|
1213
|
+
JMessageOptions *options = [self getOptionsFromDictionary:messageDict];
|
|
1138
1214
|
JMessage *message = [JIM.shared.messageManager sendMediaMessage:voiceMessage
|
|
1215
|
+
messageOption:options
|
|
1139
1216
|
inConversation:conversation
|
|
1140
1217
|
progress:^(int progress, JMessage *_Nonnull message) {
|
|
1141
1218
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
@@ -1362,6 +1439,28 @@ RCT_EXPORT_METHOD(removeMessageReaction : (
|
|
|
1362
1439
|
voice.localPath = messageDict[@"localPath"];
|
|
1363
1440
|
voice.duration = [messageDict[@"duration"] integerValue];
|
|
1364
1441
|
return voice;
|
|
1442
|
+
} else if ([contentType isEqualToString:@"jg:merge"]) {
|
|
1443
|
+
NSString *title = messageDict[@"title"];
|
|
1444
|
+
JConversation *conversation =
|
|
1445
|
+
[self convertDictionaryToConversation:messageDict[@"conversation"]];
|
|
1446
|
+
NSArray *messageIdList = messageDict[@"messageIdList"];
|
|
1447
|
+
NSArray *previewListDict = messageDict[@"previewList"];
|
|
1448
|
+
NSMutableArray *previewList = [NSMutableArray array];
|
|
1449
|
+
for (NSDictionary *previewDict in previewListDict) {
|
|
1450
|
+
[previewList addObject:[self convertDictionaryToPreviewUnit:previewDict]];
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
JMergeMessage *merge = [[JMergeMessage alloc] initWithTitle:title
|
|
1454
|
+
conversation:conversation
|
|
1455
|
+
MessageIdList:messageIdList
|
|
1456
|
+
previewList:previewList];
|
|
1457
|
+
if (messageDict[@"containerMsgId"]) {
|
|
1458
|
+
merge.containerMsgId = messageDict[@"containerMsgId"];
|
|
1459
|
+
}
|
|
1460
|
+
if (messageDict[@"extra"]) {
|
|
1461
|
+
merge.extra = messageDict[@"extra"];
|
|
1462
|
+
}
|
|
1463
|
+
return merge;
|
|
1365
1464
|
} else if (self.customMessageTypes[contentType]) {
|
|
1366
1465
|
NSString *contenType = messageDict[@"contentType"];
|
|
1367
1466
|
NSError *error = nil;
|
|
@@ -1475,7 +1574,7 @@ RCT_EXPORT_METHOD(removeMessageReaction : (
|
|
|
1475
1574
|
for (NSDictionary *userDict in mentionedUsers) {
|
|
1476
1575
|
if ([userDict isKindOfClass:[NSDictionary class]] &&
|
|
1477
1576
|
userDict[@"userId"]) {
|
|
1478
|
-
JUserInfo *userInfo = [self
|
|
1577
|
+
JUserInfo *userInfo = [self convertDictionaryToJUserInfo:userDict];
|
|
1479
1578
|
[userArray addObject:userInfo];
|
|
1480
1579
|
}
|
|
1481
1580
|
}
|
|
@@ -1483,13 +1582,36 @@ RCT_EXPORT_METHOD(removeMessageReaction : (
|
|
|
1483
1582
|
|
|
1484
1583
|
return mentionInfo;
|
|
1485
1584
|
}
|
|
1486
|
-
|
|
1487
|
-
- (JUserInfo *)
|
|
1585
|
+
|
|
1586
|
+
- (JUserInfo *)convertDictionaryToJUserInfo:(NSDictionary *)dict {
|
|
1488
1587
|
JUserInfo *userInfo = [[JUserInfo alloc] init];
|
|
1489
|
-
|
|
1588
|
+
if (dict[@"userId"]) {
|
|
1589
|
+
userInfo.userId = dict[@"userId"];
|
|
1590
|
+
}
|
|
1591
|
+
if (dict[@"nickname"]) {
|
|
1592
|
+
userInfo.userName = dict[@"nickname"];
|
|
1593
|
+
}
|
|
1594
|
+
if (dict[@"avatar"]) {
|
|
1595
|
+
userInfo.portrait = dict[@"avatar"];
|
|
1596
|
+
}
|
|
1597
|
+
if (dict[@"extra"]) {
|
|
1598
|
+
userInfo.extraDic = dict[@"extra"];
|
|
1599
|
+
}
|
|
1490
1600
|
return userInfo;
|
|
1491
1601
|
}
|
|
1492
1602
|
|
|
1603
|
+
- (JMergeMessagePreviewUnit *)convertDictionaryToPreviewUnit:
|
|
1604
|
+
(NSDictionary *)dict {
|
|
1605
|
+
JMergeMessagePreviewUnit *unit = [[JMergeMessagePreviewUnit alloc] init];
|
|
1606
|
+
if (dict[@"previewContent"]) {
|
|
1607
|
+
unit.previewContent = dict[@"previewContent"];
|
|
1608
|
+
}
|
|
1609
|
+
if (dict[@"sender"]) {
|
|
1610
|
+
unit.sender = [self convertDictionaryToJUserInfo:dict[@"sender"]];
|
|
1611
|
+
}
|
|
1612
|
+
return unit;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1493
1615
|
/**
|
|
1494
1616
|
* 发送消息已读回执
|
|
1495
1617
|
*/
|
|
@@ -1561,4 +1683,121 @@ RCT_EXPORT_METHOD(
|
|
|
1561
1683
|
}];
|
|
1562
1684
|
}
|
|
1563
1685
|
|
|
1686
|
+
- (JMessageOptions *)getOptionsFromDictionary:(NSDictionary *)dict {
|
|
1687
|
+
JMessageOptions *options = [[JMessageOptions alloc] init];
|
|
1688
|
+
if (dict[@"mentionInfo"]) {
|
|
1689
|
+
options.mentionInfo =
|
|
1690
|
+
[self convertDictToMessageMentionInfo:dict[@"mentionInfo"]];
|
|
1691
|
+
}
|
|
1692
|
+
if (dict[@"referredMessageId"]) {
|
|
1693
|
+
options.referredMsgId = dict[@"referredMessageId"];
|
|
1694
|
+
}
|
|
1695
|
+
if (dict[@"pushData"]) {
|
|
1696
|
+
options.pushData = [self convertDictToPushData:dict[@"pushData"]];
|
|
1697
|
+
}
|
|
1698
|
+
if (dict[@"lifeTime"]) {
|
|
1699
|
+
options.lifeTime = [dict[@"lifeTime"] longLongValue];
|
|
1700
|
+
}
|
|
1701
|
+
if (dict[@"lifeTimeAfterRead"]) {
|
|
1702
|
+
options.lifeTimeAfterRead = [dict[@"lifeTimeAfterRead"] longLongValue];
|
|
1703
|
+
}
|
|
1704
|
+
return options;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
- (JPushData *)convertDictToPushData:(NSDictionary *)dict {
|
|
1708
|
+
JPushData *pushData = [[JPushData alloc] init];
|
|
1709
|
+
if (dict[@"content"]) {
|
|
1710
|
+
pushData.content = dict[@"content"];
|
|
1711
|
+
}
|
|
1712
|
+
if (dict[@"extra"]) {
|
|
1713
|
+
pushData.extra = dict[@"extra"];
|
|
1714
|
+
}
|
|
1715
|
+
return pushData;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* 获取合并消息列表
|
|
1720
|
+
*/
|
|
1721
|
+
RCT_EXPORT_METHOD(getMergedMessageList : (NSString *)messageId resolver : (
|
|
1722
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1723
|
+
[[JIM shared].messageManager getMergedMessageList:messageId
|
|
1724
|
+
success:^(NSArray<JMessage *> *mergedMessages) {
|
|
1725
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1726
|
+
for (JMessage *msg in mergedMessages) {
|
|
1727
|
+
[array addObject:[self convertMessageToDictionary:msg]];
|
|
1728
|
+
}
|
|
1729
|
+
resolve(array);
|
|
1730
|
+
}
|
|
1731
|
+
error:^(JErrorCode code) {
|
|
1732
|
+
reject([NSString stringWithFormat:@"%ld", (long)code],
|
|
1733
|
+
@"getMergedMessageList failed", nil);
|
|
1734
|
+
}];
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* 从服务端获取用户信息
|
|
1739
|
+
*/
|
|
1740
|
+
RCT_EXPORT_METHOD(fetchUserInfo : (NSString *)userId resolver : (
|
|
1741
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1742
|
+
[[JIM shared].userInfoManager fetchUserInfo:userId
|
|
1743
|
+
success:^(JUserInfo *userInfo) {
|
|
1744
|
+
if (userInfo) {
|
|
1745
|
+
resolve([self convertUserInfoToDictionary:userInfo]);
|
|
1746
|
+
} else {
|
|
1747
|
+
resolve([NSNull null]);
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
error:^(JErrorCode code) {
|
|
1751
|
+
reject([NSString stringWithFormat:@"%ld", (long)code],
|
|
1752
|
+
@"fetchUserInfo failed", nil);
|
|
1753
|
+
}];
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* 从服务端获取群组信息
|
|
1758
|
+
*/
|
|
1759
|
+
RCT_EXPORT_METHOD(fetchGroupInfo : (NSString *)groupId resolver : (
|
|
1760
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1761
|
+
[[JIM shared].userInfoManager fetchGroupInfo:groupId
|
|
1762
|
+
success:^(JGroupInfo *groupInfo) {
|
|
1763
|
+
if (groupInfo) {
|
|
1764
|
+
resolve([self convertGroupInfoToDictionary:groupInfo]);
|
|
1765
|
+
} else {
|
|
1766
|
+
resolve([NSNull null]);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
error:^(JErrorCode code) {
|
|
1770
|
+
reject([NSString stringWithFormat:@"%ld", (long)code],
|
|
1771
|
+
@"fetchGroupInfo failed", nil);
|
|
1772
|
+
}];
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* 批量获取用户信息
|
|
1777
|
+
*/
|
|
1778
|
+
RCT_EXPORT_METHOD(getUserInfoList : (NSArray *)userIdList resolver : (
|
|
1779
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1780
|
+
NSArray<JUserInfo *> *users =
|
|
1781
|
+
[[JIM shared].userInfoManager getUserInfoList:userIdList];
|
|
1782
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1783
|
+
for (JUserInfo *user in users) {
|
|
1784
|
+
[array addObject:[self convertUserInfoToDictionary:user]];
|
|
1785
|
+
}
|
|
1786
|
+
resolve(array);
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* 批量获取群组信息
|
|
1791
|
+
*/
|
|
1792
|
+
RCT_EXPORT_METHOD(getGroupInfoList : (NSArray *)groupIdList resolver : (
|
|
1793
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1794
|
+
NSArray<JGroupInfo *> *groups =
|
|
1795
|
+
[[JIM shared].userInfoManager getGroupInfoList:groupIdList];
|
|
1796
|
+
NSMutableArray *array = [NSMutableArray new];
|
|
1797
|
+
for (JGroupInfo *group in groups) {
|
|
1798
|
+
[array addObject:[self convertGroupInfoToDictionary:group]];
|
|
1799
|
+
}
|
|
1800
|
+
resolve(array);
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1564
1803
|
@end
|
package/juggleim-rnsdk.podspec
CHANGED
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -26,7 +26,10 @@ import {
|
|
|
26
26
|
CustomMessageConstructor,
|
|
27
27
|
UpdateMessageCallback,
|
|
28
28
|
GetMessageOptions,
|
|
29
|
-
MessageResponse
|
|
29
|
+
MessageResponse,
|
|
30
|
+
GroupInfo,
|
|
31
|
+
GroupMember,
|
|
32
|
+
UserInfo
|
|
30
33
|
} from './types';
|
|
31
34
|
|
|
32
35
|
/**
|
|
@@ -430,6 +433,28 @@ export default class JuggleIM {
|
|
|
430
433
|
messageIds: string[],
|
|
431
434
|
): Promise<Boolean>;
|
|
432
435
|
|
|
436
|
+
/**
|
|
437
|
+
* 获取用户信息
|
|
438
|
+
* @param userId 用户ID
|
|
439
|
+
* @returns {Promise<UserInfo | null>} 用户信息
|
|
440
|
+
*/
|
|
441
|
+
static getUserInfo(userId: string): Promise<UserInfo | null>;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* 获取群组信息
|
|
445
|
+
* @param groupId 群组ID
|
|
446
|
+
* @returns {Promise<GroupInfo | null>} 群组信息
|
|
447
|
+
*/
|
|
448
|
+
static getGroupInfo(groupId: string): Promise<GroupInfo | null>;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* 获取群成员信息
|
|
452
|
+
* @param groupId 群组ID
|
|
453
|
+
* @param userId 用户ID
|
|
454
|
+
* @returns {Promise<GroupMember | null>} 群成员信息
|
|
455
|
+
*/
|
|
456
|
+
static getGroupMember(groupId: string, userId: string): Promise<GroupMember | null>;
|
|
457
|
+
|
|
433
458
|
/**
|
|
434
459
|
* 更新消息
|
|
435
460
|
* @param messageId 消息ID
|
|
@@ -458,6 +483,42 @@ export default class JuggleIM {
|
|
|
458
483
|
conversation: Conversation,
|
|
459
484
|
isTop: boolean,
|
|
460
485
|
): Promise<Boolean>;
|
|
486
|
+
/**
|
|
487
|
+
* 获取合并消息列表
|
|
488
|
+
* @param messageId 合并消息ID
|
|
489
|
+
* @returns {Promise<Message[]>} 消息列表
|
|
490
|
+
*/
|
|
491
|
+
static getMergedMessageList(messageId: string): Promise<Message[]>;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* 从服务端获取用户信息同时更新本地缓存为最新数据
|
|
495
|
+
* 注意:可以在进入会话页面/个人详情页面时使用此接口
|
|
496
|
+
* @param userId 用户ID
|
|
497
|
+
* @returns {Promise<UserInfo | null>} 用户信息
|
|
498
|
+
*/
|
|
499
|
+
static fetchUserInfo(userId: string): Promise<UserInfo | null>;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* 从服务端获取群组信息同时更新本地缓存为最新数据
|
|
503
|
+
* 注意:可以在进入群组页面时使用此接口
|
|
504
|
+
* @param groupId 群组ID
|
|
505
|
+
* @returns {Promise<GroupInfo | null>} 群组信息
|
|
506
|
+
*/
|
|
507
|
+
static fetchGroupInfo(groupId: string): Promise<GroupInfo | null>;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* 批量获取用户信息
|
|
511
|
+
* @param userIdList 用户ID列表
|
|
512
|
+
* @returns {Promise<UserInfo[]>} 用户信息列表
|
|
513
|
+
*/
|
|
514
|
+
static getUserInfoList(userIdList: string[]): Promise<UserInfo[]>;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* 批量获取群组信息
|
|
518
|
+
* @param groupIdList 群组ID列表
|
|
519
|
+
* @returns {Promise<GroupInfo[]>} 群组信息列表
|
|
520
|
+
*/
|
|
521
|
+
static getGroupInfoList(groupIdList: string[]): Promise<GroupInfo[]>;
|
|
461
522
|
}
|
|
462
523
|
|
|
463
524
|
|