juggleim-rnsdk 0.1.9 → 0.1.11
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/JuggleIMPackage.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$1.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$10.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$2.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$3.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$4.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$5.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$6.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$7.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$8.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule$9.dex +0 -0
- package/android/build/.transforms/a3b636e0768beb7635f48b7f77613c33/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/moment/JuggleIMMomentModule.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/JuggleIMPackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$10.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$7.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$8.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule$9.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/moment/JuggleIMMomentModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$10.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$7.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$8.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule$9.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/moment/JuggleIMMomentModule.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.uniqueId14 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMCallModule$3.class.uniqueId11 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMCallModule.class.uniqueId1 +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 → JuggleIMManager$11.class.uniqueId18} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$12.class.uniqueId23 → JuggleIMManager$12.class.uniqueId27} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$13.class.uniqueId7 → JuggleIMManager$13.class.uniqueId9} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$14.class.uniqueId16 → JuggleIMManager$14.class.uniqueId20} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$15.class.uniqueId6 → JuggleIMManager$15.class.uniqueId8} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$16.class.uniqueId11 → JuggleIMManager$16.class.uniqueId15} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$17.class.uniqueId24 → JuggleIMManager$17.class.uniqueId28} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$18.class.uniqueId8 → JuggleIMManager$18.class.uniqueId10} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$19.class.uniqueId21 → JuggleIMManager$19.class.uniqueId25} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$20.class.uniqueId5 → JuggleIMManager$20.class.uniqueId7} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$21.class.uniqueId13 → JuggleIMManager$21.class.uniqueId17} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$22.class.uniqueId19 → JuggleIMManager$22.class.uniqueId23} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$23.class.uniqueId10 → JuggleIMManager$23.class.uniqueId13} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$6.class.uniqueId12 → JuggleIMManager$6.class.uniqueId16} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$7.class.uniqueId4 → JuggleIMManager$7.class.uniqueId6} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$8.class.uniqueId17 → JuggleIMManager$8.class.uniqueId21} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$9.class.uniqueId20 → JuggleIMManager$9.class.uniqueId24} +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager.class.uniqueId1 → JuggleIMManager.class.uniqueId3} +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/JuggleIMPackage.java +2 -0
- package/android/src/main/java/com/juggleim/moment/JuggleIMMomentModule.java +376 -0
- package/ios/JModelFactory.m +14 -14
- package/ios/moment/JuggleIMMomentModule.h +5 -0
- package/ios/moment/JuggleIMMomentModule.m +207 -0
- package/juggleim-rnsdk.podspec +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +3 -0
- package/src/index.js +8 -13
- package/src/moment/index.ts +85 -0
- package/src/moment/types.ts +51 -0
- package/src/types.js +117 -0
- package/ios/call/README.md +0 -51
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$1.class.uniqueId25 → JuggleIMManager$1.class.uniqueId29} +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$2.class.uniqueId3 → JuggleIMManager$2.class.uniqueId5} +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$24.class.uniqueId15 → JuggleIMManager$24.class.uniqueId19} +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$3.class.uniqueId18 → JuggleIMManager$3.class.uniqueId22} +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$4.class.uniqueId22 → JuggleIMManager$4.class.uniqueId26} +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMManager$5.class.uniqueId9 → JuggleIMManager$5.class.uniqueId12} +0 -0
- /package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/{JuggleIMPackage.class.uniqueId2 → JuggleIMPackage.class.uniqueId4} +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#import "JuggleIMMomentModule.h"
|
|
2
|
+
#import "../JModelFactory.h"
|
|
3
|
+
#import <JuggleIM/JuggleIM.h>
|
|
4
|
+
|
|
5
|
+
@implementation JuggleIMMomentModule
|
|
6
|
+
|
|
7
|
+
RCT_EXPORT_MODULE()
|
|
8
|
+
|
|
9
|
+
- (id<JMomentProtocol>)getMomentManager {
|
|
10
|
+
return [JIM.shared momentManager];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
RCT_EXPORT_METHOD(addMoment : (NSString *)content mediaList : (NSArray *)
|
|
14
|
+
mediaList resolver : (RCTPromiseResolveBlock)
|
|
15
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
16
|
+
NSMutableArray *mediaArray = [NSMutableArray array];
|
|
17
|
+
if (mediaList) {
|
|
18
|
+
for (NSDictionary *dic in mediaList) {
|
|
19
|
+
JMomentMedia *media = [JModelFactory momentMediaFromDic:dic];
|
|
20
|
+
if (media) {
|
|
21
|
+
[mediaArray addObject:media];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[[self getMomentManager]
|
|
27
|
+
addMoment:content
|
|
28
|
+
mediaList:mediaArray
|
|
29
|
+
complete:^(JErrorCode errorCode, JMoment *_Nullable moment) {
|
|
30
|
+
if (errorCode == JErrorCodeNone) {
|
|
31
|
+
resolve([JModelFactory momentToDic:moment]);
|
|
32
|
+
} else {
|
|
33
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
34
|
+
@"addMoment failed", nil);
|
|
35
|
+
}
|
|
36
|
+
}];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
RCT_EXPORT_METHOD(removeMoment : (NSString *)momentId resolver : (
|
|
40
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
41
|
+
[[self getMomentManager]
|
|
42
|
+
removeMoment:momentId
|
|
43
|
+
complete:^(JErrorCode errorCode) {
|
|
44
|
+
if (errorCode == JErrorCodeNone) {
|
|
45
|
+
resolve(nil);
|
|
46
|
+
} else {
|
|
47
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
48
|
+
@"removeMoment failed", nil);
|
|
49
|
+
}
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
RCT_EXPORT_METHOD(getCachedMomentList : (NSDictionary *)optionMap resolver : (
|
|
54
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
55
|
+
JGetMomentOption *option = [JModelFactory getMomentOptionFromDic:optionMap];
|
|
56
|
+
NSArray *list = [[self getMomentManager] getCachedMomentList:option];
|
|
57
|
+
NSMutableArray *array = [NSMutableArray array];
|
|
58
|
+
for (JMoment *moment in list) {
|
|
59
|
+
[array addObject:[JModelFactory momentToDic:moment]];
|
|
60
|
+
}
|
|
61
|
+
resolve(array);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
RCT_EXPORT_METHOD(getMomentList : (NSDictionary *)optionMap resolver : (
|
|
65
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
66
|
+
JGetMomentOption *option = [JModelFactory getMomentOptionFromDic:optionMap];
|
|
67
|
+
[[self getMomentManager]
|
|
68
|
+
getMomentList:option
|
|
69
|
+
complete:^(JErrorCode errorCode,
|
|
70
|
+
NSArray<JMoment *> *_Nullable momentList, BOOL isFinish) {
|
|
71
|
+
if (errorCode == JErrorCodeNone) {
|
|
72
|
+
NSMutableArray *array = [NSMutableArray array];
|
|
73
|
+
for (JMoment *moment in momentList) {
|
|
74
|
+
[array addObject:[JModelFactory momentToDic:moment]];
|
|
75
|
+
}
|
|
76
|
+
resolve(@{@"list" : array, @"isFinished" : @(isFinish)});
|
|
77
|
+
} else {
|
|
78
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
79
|
+
@"getMomentList failed", nil);
|
|
80
|
+
}
|
|
81
|
+
}];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
RCT_EXPORT_METHOD(getMoment : (NSString *)momentId resolver : (
|
|
85
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
86
|
+
[[self getMomentManager]
|
|
87
|
+
getMoment:momentId
|
|
88
|
+
complete:^(JErrorCode errorCode, JMoment *_Nullable moment) {
|
|
89
|
+
if (errorCode == JErrorCodeNone) {
|
|
90
|
+
resolve([JModelFactory momentToDic:moment]);
|
|
91
|
+
} else {
|
|
92
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
93
|
+
@"getMoment failed", nil);
|
|
94
|
+
}
|
|
95
|
+
}];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
RCT_EXPORT_METHOD(addComment : (NSString *)momentId parentCommentId : (
|
|
99
|
+
NSString *)parentCommentId content : (NSString *)
|
|
100
|
+
content resolver : (RCTPromiseResolveBlock)
|
|
101
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
102
|
+
[[self getMomentManager]
|
|
103
|
+
addComment:momentId
|
|
104
|
+
parentCommentId:parentCommentId
|
|
105
|
+
content:content
|
|
106
|
+
complete:^(JErrorCode errorCode,
|
|
107
|
+
JMomentComment *_Nullable comment) {
|
|
108
|
+
if (errorCode == JErrorCodeNone) {
|
|
109
|
+
resolve([JModelFactory momentCommentToDic:comment]);
|
|
110
|
+
} else {
|
|
111
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
112
|
+
@"addComment failed", nil);
|
|
113
|
+
}
|
|
114
|
+
}];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
RCT_EXPORT_METHOD(removeComment : (NSString *)momentId commentId : (NSString *)
|
|
118
|
+
commentId resolver : (RCTPromiseResolveBlock)
|
|
119
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
120
|
+
[[self getMomentManager]
|
|
121
|
+
removeComment:commentId
|
|
122
|
+
momentId:momentId
|
|
123
|
+
complete:^(JErrorCode errorCode) {
|
|
124
|
+
if (errorCode == JErrorCodeNone) {
|
|
125
|
+
resolve(nil);
|
|
126
|
+
} else {
|
|
127
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
128
|
+
@"removeComment failed", nil);
|
|
129
|
+
}
|
|
130
|
+
}];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
RCT_EXPORT_METHOD(getCommentList : (NSDictionary *)optionMap resolver : (
|
|
134
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
135
|
+
JGetMomentCommentOption *option =
|
|
136
|
+
[JModelFactory getMomentCommentOptionFromDic:optionMap];
|
|
137
|
+
[[self getMomentManager]
|
|
138
|
+
getCommentList:option
|
|
139
|
+
complete:^(JErrorCode errorCode,
|
|
140
|
+
NSArray<JMomentComment *> *_Nullable commentList,
|
|
141
|
+
BOOL isFinish) {
|
|
142
|
+
if (errorCode == JErrorCodeNone) {
|
|
143
|
+
NSMutableArray *array = [NSMutableArray array];
|
|
144
|
+
for (JMomentComment *comment in commentList) {
|
|
145
|
+
[array addObject:[JModelFactory momentCommentToDic:comment]];
|
|
146
|
+
}
|
|
147
|
+
resolve(@{@"list" : array, @"isFinished" : @(isFinish)});
|
|
148
|
+
} else {
|
|
149
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
150
|
+
@"getCommentList failed", nil);
|
|
151
|
+
}
|
|
152
|
+
}];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
RCT_EXPORT_METHOD(addReaction : (NSString *)momentId key : (NSString *)
|
|
156
|
+
key resolver : (RCTPromiseResolveBlock)
|
|
157
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
158
|
+
[[self getMomentManager]
|
|
159
|
+
addReaction:momentId
|
|
160
|
+
key:key
|
|
161
|
+
complete:^(JErrorCode errorCode) {
|
|
162
|
+
if (errorCode == JErrorCodeNone) {
|
|
163
|
+
resolve(nil);
|
|
164
|
+
} else {
|
|
165
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
166
|
+
@"addReaction failed", nil);
|
|
167
|
+
}
|
|
168
|
+
}];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
RCT_EXPORT_METHOD(removeReaction : (NSString *)momentId key : (NSString *)
|
|
172
|
+
key resolver : (RCTPromiseResolveBlock)
|
|
173
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
174
|
+
[[self getMomentManager]
|
|
175
|
+
removeReaction:momentId
|
|
176
|
+
key:key
|
|
177
|
+
complete:^(JErrorCode errorCode) {
|
|
178
|
+
if (errorCode == JErrorCodeNone) {
|
|
179
|
+
resolve(nil);
|
|
180
|
+
} else {
|
|
181
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
182
|
+
@"removeReaction failed", nil);
|
|
183
|
+
}
|
|
184
|
+
}];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
RCT_EXPORT_METHOD(getReactionList : (NSString *)momentId resolver : (
|
|
188
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
189
|
+
[[self getMomentManager]
|
|
190
|
+
getReactionList:momentId
|
|
191
|
+
complete:^(JErrorCode errorCode,
|
|
192
|
+
NSArray<JMomentReaction *> *_Nullable reactionList) {
|
|
193
|
+
if (errorCode == JErrorCodeNone) {
|
|
194
|
+
NSMutableArray *array = [NSMutableArray array];
|
|
195
|
+
for (JMomentReaction *reaction in reactionList) {
|
|
196
|
+
[array
|
|
197
|
+
addObject:[JModelFactory momentReactionToDic:reaction]];
|
|
198
|
+
}
|
|
199
|
+
resolve(array);
|
|
200
|
+
} else {
|
|
201
|
+
reject([NSString stringWithFormat:@"%ld", (long)errorCode],
|
|
202
|
+
@"getReactionList failed", nil);
|
|
203
|
+
}
|
|
204
|
+
}];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@end
|
package/juggleim-rnsdk.podspec
CHANGED
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -981,18 +981,13 @@ class JuggleIM {
|
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
|
|
984
|
-
|
|
985
|
-
* 自定义消息内容基类
|
|
986
|
-
* 用于创建自定义消息类型
|
|
987
|
-
*/
|
|
988
|
-
export class CustomMessageContent {
|
|
989
|
-
/**
|
|
990
|
-
* @param {string} contentType - 消息内容类型
|
|
991
|
-
*/
|
|
992
|
-
constructor(contentType) {
|
|
993
|
-
this.contentType = contentType;
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
|
|
984
|
+
export * from './types';
|
|
997
985
|
export * from './call';
|
|
986
|
+
export * from './moment/types';
|
|
987
|
+
import { JuggleIMMoment } from './moment/index';
|
|
988
|
+
|
|
989
|
+
export {
|
|
990
|
+
JuggleIMMoment,
|
|
991
|
+
JuggleIM
|
|
992
|
+
};
|
|
998
993
|
export default JuggleIM;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
import { NativeModules, Platform } from 'react-native';
|
|
3
|
+
import { Moment, MomentComment, MomentReaction, GetMomentOption, GetMomentCommentOption } from './types';
|
|
4
|
+
import { SimpleCallback, UserInfo } from '../types';
|
|
5
|
+
|
|
6
|
+
const { JuggleIMMomentModule } = NativeModules;
|
|
7
|
+
|
|
8
|
+
export class JuggleIMMoment {
|
|
9
|
+
/**
|
|
10
|
+
* 发布朋友圈
|
|
11
|
+
*/
|
|
12
|
+
static addMoment(content: string, mediaList: any[]): Promise<Moment> {
|
|
13
|
+
return JuggleIMMomentModule.addMoment(content, mediaList);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 删除朋友圈
|
|
18
|
+
*/
|
|
19
|
+
static removeMoment(momentId: string): Promise<void> {
|
|
20
|
+
return JuggleIMMomentModule.removeMoment(momentId);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 获取缓存的朋友圈列表
|
|
25
|
+
*/
|
|
26
|
+
static getCachedMomentList(option: GetMomentOption): Promise<Moment[]> {
|
|
27
|
+
return JuggleIMMomentModule.getCachedMomentList(option);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 获取朋友圈列表
|
|
32
|
+
*/
|
|
33
|
+
static getMomentList(option: GetMomentOption): Promise<{ list: Moment[], isFinished: boolean }> {
|
|
34
|
+
return JuggleIMMomentModule.getMomentList(option);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 获取朋友圈详情
|
|
39
|
+
*/
|
|
40
|
+
static getMoment(momentId: string): Promise<Moment> {
|
|
41
|
+
return JuggleIMMomentModule.getMoment(momentId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 发布评论
|
|
46
|
+
*/
|
|
47
|
+
static addComment(momentId: string, parentCommentId: string, content: string): Promise<MomentComment> {
|
|
48
|
+
return JuggleIMMomentModule.addComment(momentId, parentCommentId, content);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 删除评论
|
|
53
|
+
*/
|
|
54
|
+
static removeComment(momentId: string, commentId: string): Promise<void> {
|
|
55
|
+
return JuggleIMMomentModule.removeComment(momentId, commentId);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 获取评论列表
|
|
60
|
+
*/
|
|
61
|
+
static getCommentList(option: GetMomentCommentOption): Promise<{ list: MomentComment[], isFinished: boolean }> {
|
|
62
|
+
return JuggleIMMomentModule.getCommentList(option);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 添加点赞
|
|
67
|
+
*/
|
|
68
|
+
static addReaction(momentId: string, key: string): Promise<void> {
|
|
69
|
+
return JuggleIMMomentModule.addReaction(momentId, key);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 取消点赞
|
|
74
|
+
*/
|
|
75
|
+
static removeReaction(momentId: string, key: string): Promise<void> {
|
|
76
|
+
return JuggleIMMomentModule.removeReaction(momentId, key);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 获取点赞列表
|
|
81
|
+
*/
|
|
82
|
+
static getReactionList(momentId: string): Promise<MomentReaction[]> {
|
|
83
|
+
return JuggleIMMomentModule.getReactionList(momentId);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
import { UserInfo, SimpleCallback } from '../types';
|
|
3
|
+
|
|
4
|
+
export type MomentMediaType = 'image' | 'video';
|
|
5
|
+
|
|
6
|
+
export interface MomentMedia {
|
|
7
|
+
type: MomentMediaType;
|
|
8
|
+
url: string;
|
|
9
|
+
snapshotUrl?: string; // For video thumbnail or image thumbnail
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
duration?: number; // Only for video
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface MomentComment {
|
|
16
|
+
commentId: string;
|
|
17
|
+
momentId: string;
|
|
18
|
+
parentCommentId?: string;
|
|
19
|
+
content: string;
|
|
20
|
+
userInfo: UserInfo;
|
|
21
|
+
parentUserInfo?: UserInfo;
|
|
22
|
+
createTime: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface MomentReaction {
|
|
26
|
+
key: string;
|
|
27
|
+
userList: UserInfo[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Moment {
|
|
31
|
+
momentId: string;
|
|
32
|
+
content: string;
|
|
33
|
+
mediaList: MomentMedia[];
|
|
34
|
+
userInfo: UserInfo;
|
|
35
|
+
commentList: MomentComment[];
|
|
36
|
+
reactionList: MomentReaction[];
|
|
37
|
+
createTime: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface GetMomentOption {
|
|
41
|
+
count: number;
|
|
42
|
+
timestamp: number; // 0 for initial
|
|
43
|
+
direction: number; // 0 for new, 1 for old
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface GetMomentCommentOption {
|
|
47
|
+
momentId: string;
|
|
48
|
+
count: number;
|
|
49
|
+
timestamp: number;
|
|
50
|
+
direction: number;
|
|
51
|
+
}
|
package/src/types.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* 会话类型
|
|
4
|
+
*/
|
|
5
|
+
export const ConversationType = {
|
|
6
|
+
PRIVATE: 1,
|
|
7
|
+
GROUP: 2,
|
|
8
|
+
CHATROOM: 3,
|
|
9
|
+
SYSTEM: 4,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 消息内容基类
|
|
14
|
+
*/
|
|
15
|
+
export class MessageContent {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.contentType = "";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 自定义消息内容
|
|
23
|
+
*/
|
|
24
|
+
export class CustomMessageContent extends MessageContent {
|
|
25
|
+
constructor(contentType) {
|
|
26
|
+
super();
|
|
27
|
+
this.contentType = contentType;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 文本消息内容
|
|
33
|
+
*/
|
|
34
|
+
export class TextMessageContent extends MessageContent {
|
|
35
|
+
constructor(content) {
|
|
36
|
+
super();
|
|
37
|
+
this.contentType = "jg:text";
|
|
38
|
+
this.content = content;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 撤回消息内容
|
|
44
|
+
*/
|
|
45
|
+
export class RecallInfoMessageContent extends MessageContent {
|
|
46
|
+
constructor() {
|
|
47
|
+
super();
|
|
48
|
+
this.contentType = "jg:recallinfo";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 合并消息内容
|
|
54
|
+
*/
|
|
55
|
+
export class MergeMessageContent extends MessageContent {
|
|
56
|
+
constructor(
|
|
57
|
+
title,
|
|
58
|
+
conversation,
|
|
59
|
+
messageIdList,
|
|
60
|
+
previewList
|
|
61
|
+
) {
|
|
62
|
+
super();
|
|
63
|
+
this.contentType = "jg:merge";
|
|
64
|
+
this.title = title;
|
|
65
|
+
this.conversation = conversation;
|
|
66
|
+
this.messageIdList = messageIdList;
|
|
67
|
+
this.previewList = previewList;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 合并消息预览单元
|
|
73
|
+
*/
|
|
74
|
+
export class MergeMessagePreviewUnit {
|
|
75
|
+
constructor(previewContent, sender) {
|
|
76
|
+
this.previewContent = previewContent;
|
|
77
|
+
this.sender = sender;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 图片消息内容
|
|
83
|
+
*/
|
|
84
|
+
export class ImageMessageContent extends MessageContent {
|
|
85
|
+
constructor(localPath, width, height) {
|
|
86
|
+
super();
|
|
87
|
+
this.contentType = "jg:img";
|
|
88
|
+
this.localPath = localPath;
|
|
89
|
+
this.width = width;
|
|
90
|
+
this.height = height;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 文件消息内容
|
|
96
|
+
*/
|
|
97
|
+
export class FileMessageContent extends MessageContent {
|
|
98
|
+
constructor(localPath, name, size) {
|
|
99
|
+
super();
|
|
100
|
+
this.contentType = "jg:file";
|
|
101
|
+
this.localPath = localPath;
|
|
102
|
+
this.name = name;
|
|
103
|
+
this.size = size;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 语音消息内容
|
|
109
|
+
*/
|
|
110
|
+
export class VoiceMessageContent extends MessageContent {
|
|
111
|
+
constructor(localPath, duration) {
|
|
112
|
+
super();
|
|
113
|
+
this.contentType = "jg:voice";
|
|
114
|
+
this.localPath = localPath;
|
|
115
|
+
this.duration = duration;
|
|
116
|
+
}
|
|
117
|
+
}
|
package/ios/call/README.md
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# iOS Call Module - File Summary
|
|
2
|
-
|
|
3
|
-
## Created Files
|
|
4
|
-
|
|
5
|
-
### Bridge Module
|
|
6
|
-
- `ios/call/JuggleIMCallModule.h` - Main bridge module header
|
|
7
|
-
- `ios/call/JuggleIMCallModule.m` - Main bridge module implementation (450+ lines)
|
|
8
|
-
|
|
9
|
-
### View Components
|
|
10
|
-
- `ios/call/view/ZegoSurfaceView.h` - Video surface view header
|
|
11
|
-
- `ios/call/view/ZegoSurfaceView.m` - Video surface view implementation
|
|
12
|
-
- `ios/call/view/ZegoSurfaceViewManager.h` - View manager header
|
|
13
|
-
- `ios/call/view/ZegoSurfaceViewManager.m` - View manager implementation
|
|
14
|
-
|
|
15
|
-
## Modified Files
|
|
16
|
-
|
|
17
|
-
### Field Mapping Fixes
|
|
18
|
-
- `ios/JModelFactory.m`
|
|
19
|
-
- Line 330: `inviterId` → `inviter`
|
|
20
|
-
- Line 343: Added `currentMember` field
|
|
21
|
-
- Line 163: `userName` → `nickname`
|
|
22
|
-
- Line 167: `portrait` → `avatar`
|
|
23
|
-
|
|
24
|
-
## Directory Structure
|
|
25
|
-
```
|
|
26
|
-
ios/
|
|
27
|
-
├── call/
|
|
28
|
-
│ ├── JuggleIMCallModule.h
|
|
29
|
-
│ ├── JuggleIMCallModule.m
|
|
30
|
-
│ └── view/
|
|
31
|
-
│ ├── ZegoSurfaceView.h
|
|
32
|
-
│ ├── ZegoSurfaceView.m
|
|
33
|
-
│ ├── ZegoSurfaceViewManager.h
|
|
34
|
-
│ └── ZegoSurfaceViewManager.m
|
|
35
|
-
├── JModelFactory.h (existing, no changes)
|
|
36
|
-
└── JModelFactory.m (modified)
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## TODO Items
|
|
40
|
-
|
|
41
|
-
See `walkthrough.md` for detailed TODO items that need verification:
|
|
42
|
-
1. Zego engine initialization appSign parameter
|
|
43
|
-
2. Remove delegate methods availability
|
|
44
|
-
3. Video denoise parameters conversion
|
|
45
|
-
|
|
46
|
-
## Next Steps
|
|
47
|
-
|
|
48
|
-
1. Verify TODO items against iOS SDK
|
|
49
|
-
2. Register modules in Xcode project/podspec
|
|
50
|
-
3. Test compilation
|
|
51
|
-
4. Test runtime functionality
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|