juggleim-rnsdk 0.0.8

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.
Files changed (196) hide show
  1. package/README.md +521 -0
  2. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  3. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/8.9/gc.properties +0 -0
  10. package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
  11. package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
  12. package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  16. package/android/.gradle/config.properties +2 -0
  17. package/android/.gradle/vcs-1/gc.properties +0 -0
  18. package/android/.idea/AndroidProjectSystem.xml +6 -0
  19. package/android/.idea/caches/deviceStreaming.xml +981 -0
  20. package/android/.idea/gradle.xml +12 -0
  21. package/android/.idea/migrations.xml +10 -0
  22. package/android/.idea/misc.xml +10 -0
  23. package/android/.idea/runConfigurations.xml +17 -0
  24. package/android/.idea/vcs.xml +6 -0
  25. package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
  26. package/android/build/.transforms/32937366d2d155289e73cba3894468b5/results.bin +1 -0
  27. package/android/build/.transforms/32937366d2d155289e73cba3894468b5/transformed/classes/classes_dex/classes.dex +0 -0
  28. package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/results.bin +1 -0
  29. package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
  30. package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
  31. package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
  32. package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  33. package/android/build/.transforms/4ae221a259570a6033b0069041b5796d/results.bin +1 -0
  34. package/android/build/.transforms/4ae221a259570a6033b0069041b5796d/transformed/classes/classes_dex/classes.dex +0 -0
  35. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/results.bin +1 -0
  36. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
  37. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$1.dex +0 -0
  38. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$2.dex +0 -0
  39. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
  40. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
  41. package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  42. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/results.bin +1 -0
  43. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
  44. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/FileUtils.dex +0 -0
  45. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$1.dex +0 -0
  46. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$10.dex +0 -0
  47. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$11.dex +0 -0
  48. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$12.dex +0 -0
  49. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$13.dex +0 -0
  50. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$14.dex +0 -0
  51. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$15.dex +0 -0
  52. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$16.dex +0 -0
  53. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$17.dex +0 -0
  54. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$18.dex +0 -0
  55. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$2.dex +0 -0
  56. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$3.dex +0 -0
  57. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$4.dex +0 -0
  58. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$5.dex +0 -0
  59. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$6.dex +0 -0
  60. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$7.dex +0 -0
  61. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$8.dex +0 -0
  62. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$9.dex +0 -0
  63. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
  64. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
  65. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/RNTypeConverter$1.dex +0 -0
  66. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/RNTypeConverter.dex +0 -0
  67. package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  68. package/android/build/.transforms/c196b8eedd9d5b3ab65791cf668fe454/results.bin +1 -0
  69. package/android/build/.transforms/c196b8eedd9d5b3ab65791cf668fe454/transformed/classes/classes_dex/classes.dex +0 -0
  70. package/android/build/generated/source/buildConfig/debug/com/juggleim/BuildConfig.java +10 -0
  71. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +9 -0
  72. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
  73. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
  74. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  75. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +4 -0
  76. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  77. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  78. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  79. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  80. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  81. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  82. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  83. package/android/build/intermediates/compile_symbol_list/debug/R.txt +1958 -0
  84. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  85. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  86. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  87. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  88. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  89. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  90. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  91. package/android/build/intermediates/javac/debug/classes/com/juggleim/BuildConfig.class +0 -0
  92. package/android/build/intermediates/javac/debug/classes/com/juggleim/FileUtils.class +0 -0
  93. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$1.class +0 -0
  94. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$10.class +0 -0
  95. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$11.class +0 -0
  96. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$12.class +0 -0
  97. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$13.class +0 -0
  98. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$14.class +0 -0
  99. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$15.class +0 -0
  100. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$16.class +0 -0
  101. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$17.class +0 -0
  102. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$18.class +0 -0
  103. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$2.class +0 -0
  104. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$3.class +0 -0
  105. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$4.class +0 -0
  106. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$5.class +0 -0
  107. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$6.class +0 -0
  108. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$7.class +0 -0
  109. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$8.class +0 -0
  110. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$9.class +0 -0
  111. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager.class +0 -0
  112. package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMPackage.class +0 -0
  113. package/android/build/intermediates/javac/debug/classes/com/juggleim/RNTypeConverter$1.class +0 -0
  114. package/android/build/intermediates/javac/debug/classes/com/juggleim/RNTypeConverter.class +0 -0
  115. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/BuildConfig.class +0 -0
  116. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/FileUtils.class +0 -0
  117. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$1.class +0 -0
  118. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$10.class +0 -0
  119. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$11.class +0 -0
  120. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$12.class +0 -0
  121. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$13.class +0 -0
  122. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$14.class +0 -0
  123. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$15.class +0 -0
  124. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$16.class +0 -0
  125. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$17.class +0 -0
  126. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$18.class +0 -0
  127. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$2.class +0 -0
  128. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$3.class +0 -0
  129. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$4.class +0 -0
  130. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$5.class +0 -0
  131. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$6.class +0 -0
  132. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$7.class +0 -0
  133. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$8.class +0 -0
  134. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$9.class +0 -0
  135. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager.class +0 -0
  136. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMPackage.class +0 -0
  137. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/RNTypeConverter$1.class +0 -0
  138. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/RNTypeConverter.class +0 -0
  139. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
  140. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  141. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +11 -0
  142. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
  143. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +9 -0
  144. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
  145. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  146. package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  147. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  148. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +18 -0
  149. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/BuildConfig.class +0 -0
  150. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/FileUtils.class +0 -0
  151. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$1.class +0 -0
  152. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$10.class +0 -0
  153. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$11.class +0 -0
  154. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$12.class +0 -0
  155. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$13.class +0 -0
  156. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$14.class +0 -0
  157. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$15.class +0 -0
  158. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$16.class +0 -0
  159. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$17.class +0 -0
  160. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$18.class +0 -0
  161. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$2.class +0 -0
  162. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$3.class +0 -0
  163. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$4.class +0 -0
  164. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$5.class +0 -0
  165. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$6.class +0 -0
  166. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$7.class +0 -0
  167. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$8.class +0 -0
  168. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$9.class +0 -0
  169. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager.class +0 -0
  170. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMPackage.class +0 -0
  171. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/RNTypeConverter$1.class +0 -0
  172. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/RNTypeConverter.class +0 -0
  173. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  174. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  175. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  176. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1450 -0
  177. package/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  178. package/android/build/reports/problems/problems-report.html +663 -0
  179. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$1.class.uniqueId3 +0 -0
  180. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$2.class.uniqueId0 +0 -0
  181. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager.class.uniqueId1 +0 -0
  182. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMPackage.class.uniqueId2 +0 -0
  183. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  184. package/android/build.gradle +48 -0
  185. package/android/local.properties +8 -0
  186. package/android/src/main/AndroidManifest.xml +3 -0
  187. package/android/src/main/java/com/juggleim/FileUtils.java +104 -0
  188. package/android/src/main/java/com/juggleim/JuggleIMManager.java +1220 -0
  189. package/android/src/main/java/com/juggleim/JuggleIMPackage.java +27 -0
  190. package/android/src/main/java/com/juggleim/RNTypeConverter.java +163 -0
  191. package/im-rn-sdk.podspec +20 -0
  192. package/ios/JuggleIMManager.h +9 -0
  193. package/ios/JuggleIMManager.m +1186 -0
  194. package/package.json +45 -0
  195. package/src/index.d.ts +691 -0
  196. package/src/index.js +854 -0
@@ -0,0 +1,1186 @@
1
+ #import "JuggleIMManager.h"
2
+ #import <JuggleIM/JuggleIM.h>
3
+ #import <React/RCTEventEmitter.h>
4
+
5
+ /**
6
+ * Juggle IM React Native iOS 模块
7
+ */
8
+ @interface JuggleIMManager () <JConnectionDelegate, JMessageDelegate,
9
+ JMessageReadReceiptDelegate,
10
+ JMessageDestroyDelegate, JConversationDelegate>
11
+
12
+ @end
13
+
14
+ @implementation JuggleIMManager
15
+
16
+ RCT_EXPORT_MODULE(JuggleIM);
17
+
18
+ RCT_EXPORT_METHOD(setServerUrls : (NSArray *)urls) {
19
+ [[JIM shared] setServerUrls:urls];
20
+ }
21
+
22
+ RCT_EXPORT_METHOD(initWithAppKey : (NSString *)appKey) {
23
+ [[JIM shared] initWithAppKey:appKey];
24
+ [JIM.shared setConsoleLogLevel:JLogLevelVerbose];
25
+ }
26
+
27
+ RCT_EXPORT_METHOD(connectWithToken : (NSString *)token) {
28
+ [JIM.shared.connectionManager connectWithToken:token];
29
+ }
30
+
31
+ - (NSArray<NSString *> *)supportedEvents {
32
+ return @[
33
+ @"ConnectionStatusChanged", @"DbDidOpen", @"DbDidClose", @"MessageReceived",
34
+ @"MessageRecalled", @"MessageUpdated", @"MessageDeleted", @"MessageCleared",
35
+ @"MessageReactionAdded", @"MessageReactionRemoved", @"MessageSetTop",
36
+ @"MessagesRead", @"GroupMessagesRead", @"MessageDestroyTimeUpdated",
37
+ @"ConversationInfoAdded", @"ConversationInfoUpdated",
38
+ @"ConversationInfoDeleted", @"TotalUnreadMessageCountUpdated",
39
+ @"onMessageSent", @"onMessageSentError", @"onMediaMessageProgress",
40
+ @"onMediaMessageSent", @"onMediaMessageSentError", @"onMediaMessageCancelled"
41
+ ];
42
+ }
43
+
44
+ /**
45
+ * 添加连接状态监听器
46
+ */
47
+ RCT_EXPORT_METHOD(addConnectionDelegate) {
48
+ [JIM.shared.connectionManager addDelegate:self];
49
+ }
50
+
51
+ /**
52
+ * 添加消息监听器
53
+ */
54
+ RCT_EXPORT_METHOD(addMessageDelegate) {
55
+ [JIM.shared.messageManager addDelegate:self];
56
+ }
57
+
58
+ /**
59
+ * 添加消息阅读状态监听器
60
+ */
61
+ RCT_EXPORT_METHOD(addMessageReadReceiptDelegate) {
62
+ [JIM.shared.messageManager addReadReceiptDelegate:self];
63
+ }
64
+
65
+ /**
66
+ * 添加消息销毁监听器
67
+ */
68
+ RCT_EXPORT_METHOD(addMessageDestroyDelegate) {
69
+ [JIM.shared.messageManager addDestroyDelegate:self];
70
+ }
71
+
72
+ /**
73
+ * 添加会话监听器
74
+ */
75
+ RCT_EXPORT_METHOD(addConversationDelegate) {
76
+ [JIM.shared.conversationManager addDelegate:self];
77
+ }
78
+
79
+ #pragma mark - JConnectionDelegate
80
+
81
+ /**
82
+ * 数据库打开的回调
83
+ */
84
+ - (void)dbDidOpen {
85
+ [self sendEventWithName:@"DbDidOpen" body:@{}];
86
+ }
87
+
88
+ /**
89
+ * 数据库关闭的回调
90
+ */
91
+ - (void)dbDidClose {
92
+ [self sendEventWithName:@"DbDidClose" body:@{}];
93
+ }
94
+
95
+ /**
96
+ * 连接状态变化的回调
97
+ */
98
+ - (void)connectionStatusDidChange:(JConnectionStatus)status
99
+ errorCode:(JErrorCode)code
100
+ extra:(NSString *)extra {
101
+ NSString *statusString = [self getStatusString:status];
102
+ NSLog(@"connectionStatusDidChange: %@, code: %ld, extra: %@", statusString,
103
+ (long)code, extra);
104
+
105
+ [self sendEventWithName:@"ConnectionStatusChanged"
106
+ body:@{
107
+ @"status" : statusString,
108
+ @"code" : @(code),
109
+ @"extra" : extra ?: @""
110
+ }];
111
+ }
112
+
113
+ /**
114
+ * 将连接状态转换为字符串
115
+ */
116
+ - (NSString *)getStatusString:(JConnectionStatus)status {
117
+ switch (status) {
118
+ case JConnectionStatusConnected:
119
+ return @"connected";
120
+ case JConnectionStatusConnecting:
121
+ return @"connecting";
122
+ case JConnectionStatusDisconnected:
123
+ return @"disconnected";
124
+ case JConnectionStatusFailure:
125
+ return @"failure";
126
+ default:
127
+ return @"unknown";
128
+ }
129
+ }
130
+
131
+ #pragma mark - JMessageDelegate
132
+
133
+ /**
134
+ * 接收消息的回调
135
+ */
136
+ - (void)messageDidReceive:(JMessage *)message {
137
+ [self sendEventWithName:@"MessageReceived"
138
+ body:@{
139
+ @"message" : [self convertMessageToDictionary:message]
140
+ }];
141
+ }
142
+
143
+ /**
144
+ * 消息撤回的回调
145
+ */
146
+ - (void)messageDidRecall:(JMessage *)message {
147
+ [self sendEventWithName:@"MessageRecalled"
148
+ body:@{
149
+ @"message" : [self convertMessageToDictionary:message]
150
+ }];
151
+ }
152
+
153
+ /**
154
+ * 消息修改的回调
155
+ */
156
+ - (void)messageDidUpdate:(JMessage *)message {
157
+ [self sendEventWithName:@"MessageUpdated"
158
+ body:@{
159
+ @"message" : [self convertMessageToDictionary:message]
160
+ }];
161
+ }
162
+
163
+ /**
164
+ * 消息删除的回调
165
+ */
166
+ - (void)messageDidDelete:(JConversation *)conversation
167
+ clientMsgNos:(NSArray<NSNumber *> *)clientMsgNos {
168
+ [self sendEventWithName:@"MessageDeleted"
169
+ body:@{
170
+ @"conversation" :
171
+ [self convertConversationToDictionary:conversation],
172
+ @"clientMsgNos" : clientMsgNos
173
+ }];
174
+ }
175
+
176
+ /**
177
+ * 消息清除回调
178
+ */
179
+ - (void)messageDidClear:(JConversation *)conversation
180
+ timestamp:(long long)timestamp
181
+ senderId:(NSString *)senderId {
182
+ [self sendEventWithName:@"MessageCleared"
183
+ body:@{
184
+ @"conversation" :
185
+ [self convertConversationToDictionary:conversation],
186
+ @"timestamp" : @(timestamp),
187
+ @"senderId" : senderId ?: @""
188
+ }];
189
+ }
190
+
191
+ /**
192
+ * 新增消息回应的回调
193
+ */
194
+ - (void)messageReactionDidAdd:(JMessageReaction *)reaction
195
+ inConversation:(JConversation *)conversation {
196
+ [self sendEventWithName:@"MessageReactionAdded"
197
+ body:@{
198
+ @"conversation" :
199
+ [self convertConversationToDictionary:conversation],
200
+ @"reaction" : [self convertReactionToDictionary:reaction]
201
+ }];
202
+ }
203
+
204
+ /**
205
+ * 删除消息回应的回调
206
+ */
207
+ - (void)messageReactionDidRemove:(JMessageReaction *)reaction
208
+ inConversation:(JConversation *)conversation {
209
+ [self sendEventWithName:@"MessageReactionRemoved"
210
+ body:@{
211
+ @"conversation" :
212
+ [self convertConversationToDictionary:conversation],
213
+ @"reaction" : [self convertReactionToDictionary:reaction]
214
+ }];
215
+ }
216
+
217
+ /**
218
+ * 消息置顶的回调
219
+ */
220
+ - (void)messageDidSetTop:(BOOL)isTop
221
+ message:(JMessage *)message
222
+ user:(JUserInfo *)userInfo {
223
+ [self
224
+ sendEventWithName:@"MessageSetTop"
225
+ body:@{
226
+ @"message" : [self convertMessageToDictionary:message],
227
+ @"operator" : [self convertUserInfoToDictionary:userInfo],
228
+ @"isTop" : @(isTop)
229
+ }];
230
+ }
231
+
232
+ #pragma mark - JMessageReadReceiptDelegate
233
+
234
+ /**
235
+ * 单聊消息阅读回调
236
+ */
237
+ - (void)messagesDidRead:(NSArray<NSString *> *)messageIds
238
+ inConversation:(JConversation *)conversation {
239
+ [self sendEventWithName:@"MessagesRead"
240
+ body:@{
241
+ @"conversation" :
242
+ [self convertConversationToDictionary:conversation],
243
+ @"messageIds" : messageIds
244
+ }];
245
+ }
246
+
247
+ /**
248
+ * 群消息阅读回调
249
+ */
250
+ - (void)groupMessagesDidRead:
251
+ (NSDictionary<NSString *, JGroupMessageReadInfo *> *)msgs
252
+ inConversation:(JConversation *)conversation {
253
+ NSMutableDictionary *messages = [NSMutableDictionary dictionary];
254
+ for (NSString *key in msgs.allKeys) {
255
+ messages[key] = [self convertGroupMessageReadInfoToDictionary:msgs[key]];
256
+ }
257
+
258
+ [self sendEventWithName:@"GroupMessagesRead"
259
+ body:@{
260
+ @"conversation" :
261
+ [self convertConversationToDictionary:conversation],
262
+ @"messages" : messages
263
+ }];
264
+ }
265
+
266
+ #pragma mark - JMessageDestroyDelegate
267
+
268
+ /**
269
+ * 消息销毁时间更新回调
270
+ */
271
+ - (void)messageDestroyTimeDidUpdate:(NSString *)messageId
272
+ inConversation:(JConversation *)conversation
273
+ destroyTime:(long long)destroyTime {
274
+ [self sendEventWithName:@"MessageDestroyTimeUpdated"
275
+ body:@{
276
+ @"messageId" : messageId,
277
+ @"conversation" :
278
+ [self convertConversationToDictionary:conversation],
279
+ @"destroyTime" : @(destroyTime)
280
+ }];
281
+ }
282
+
283
+ #pragma mark - JConversationDelegate
284
+
285
+ /**
286
+ * 会话新增回调
287
+ */
288
+ - (void)conversationInfoDidAdd:
289
+ (NSArray<JConversationInfo *> *)conversationInfoList {
290
+ NSMutableArray *conversations = [NSMutableArray array];
291
+ for (JConversationInfo *info in conversationInfoList) {
292
+ [conversations addObject:[self convertConversationInfoToDictionary:info]];
293
+ }
294
+
295
+ [self sendEventWithName:@"ConversationInfoAdded"
296
+ body:@{@"conversations" : conversations}];
297
+ }
298
+
299
+ /**
300
+ * 会话变更回调
301
+ */
302
+ - (void)conversationInfoDidUpdate:
303
+ (NSArray<JConversationInfo *> *)conversationInfoList {
304
+ NSMutableArray *conversations = [NSMutableArray array];
305
+ for (JConversationInfo *info in conversationInfoList) {
306
+ [conversations addObject:[self convertConversationInfoToDictionary:info]];
307
+ }
308
+
309
+ [self sendEventWithName:@"ConversationInfoUpdated"
310
+ body:@{@"conversations" : conversations}];
311
+ }
312
+
313
+ /**
314
+ * 会话删除回调
315
+ */
316
+ - (void)conversationInfoDidDelete:
317
+ (NSArray<JConversationInfo *> *)conversationInfoList {
318
+ NSMutableArray *conversations = [NSMutableArray array];
319
+ for (JConversationInfo *info in conversationInfoList) {
320
+ [conversations addObject:[self convertConversationInfoToDictionary:info]];
321
+ }
322
+
323
+ [self sendEventWithName:@"ConversationInfoDeleted"
324
+ body:@{@"conversations" : conversations}];
325
+ }
326
+
327
+ /**
328
+ * 总的未读数变化回调
329
+ */
330
+ - (void)totalUnreadMessageCountDidUpdate:(int)count {
331
+ [self sendEventWithName:@"TotalUnreadMessageCountUpdated"
332
+ body:@{@"count" : @(count)}];
333
+ }
334
+
335
+ #pragma mark - Helper Methods
336
+
337
+ /**
338
+ * 将消息对象转换为字典
339
+ */
340
+ - (NSDictionary *)convertMessageToDictionary:(JMessage *)message {
341
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
342
+ dict[@"messageId"] = message.messageId ?: @"";
343
+ dict[@"clientMsgNo"] = [NSString stringWithFormat:@"%lld", message.clientMsgNo];
344
+ dict[@"timestamp"] = @(message.timestamp);
345
+ dict[@"senderUserId"] = message.senderUserId ?: @"";
346
+ dict[@"conversation"] =
347
+ [self convertConversationToDictionary:message.conversation];
348
+ dict[@"content"] = [self convertMessageContentToDictionary:message.content];
349
+ dict[@"direction"] = @(message.direction);
350
+ dict[@"messageState"] = @(message.messageState);
351
+
352
+ // 添加是否已读
353
+ dict[@"hasRead"] = @(message.hasRead);
354
+
355
+ // 添加群消息阅读信息
356
+ if (message.groupReadInfo) {
357
+ dict[@"groupMessageReadInfo"] = [self convertGroupMessageReadInfoToDictionary:message.groupReadInfo];
358
+ }
359
+
360
+ // 添加引用消息
361
+ if (message.referredMsg) {
362
+ dict[@"referredMessage"] = [self convertMessageToDictionary:message.referredMsg];
363
+ }
364
+
365
+ // 添加@消息信息
366
+ if (message.mentionInfo) {
367
+ dict[@"mentionInfo"] = [self convertMentionInfoToDictionary:message.mentionInfo];
368
+ }
369
+
370
+ // 添加本地属性
371
+ dict[@"localAttribute"] = message.localAttribute ?: @"";
372
+
373
+ // 添加是否删除
374
+ dict[@"isDelete"] = @(message.isDeleted);
375
+
376
+ // 添加是否编辑
377
+ dict[@"isEdit"] = @(message.isEdit);
378
+
379
+ return dict;
380
+ }
381
+
382
+ /**
383
+ * 将会话对象转换为字典
384
+ */
385
+ - (NSDictionary *)convertConversationToDictionary:
386
+ (JConversation *)conversation {
387
+ return @{
388
+ @"conversationType" : @(conversation.conversationType),
389
+ @"conversationId" : conversation.conversationId ?: @""
390
+ };
391
+ }
392
+
393
+ /**
394
+ * 将消息内容转换为字典
395
+ */
396
+ - (NSDictionary *)convertMessageContentToDictionary:(JMessageContent *)content {
397
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
398
+ dict[@"contentType"] = [[content class] contentType] ?: @"";
399
+
400
+ if ([content isKindOfClass:[JTextMessage class]]) {
401
+ JTextMessage *textMsg = (JTextMessage *)content;
402
+ dict[@"content"] = textMsg.content ?: @"";
403
+ dict[@"extra"] = textMsg.extra ?: @"";
404
+ } else if ([content isKindOfClass:[JImageMessage class]]) {
405
+ JImageMessage *imgMsg = (JImageMessage *)content;
406
+ dict[@"url"] = imgMsg.url ?: @"";
407
+ dict[@"localPath"] = imgMsg.localPath ?: @"";
408
+ dict[@"thumbnailUrl"] = imgMsg.thumbnailUrl ?: @"";
409
+ dict[@"thumbnailLocalPath"] = imgMsg.thumbnailLocalPath ?: @"";
410
+ dict[@"extra"] = imgMsg.extra ?: @"";
411
+ dict[@"width"] = @(imgMsg.width);
412
+ dict[@"height"] = @(imgMsg.height);
413
+ } else if ([content isKindOfClass:[JFileMessage class]]) {
414
+ JFileMessage *fileMsg = (JFileMessage *)content;
415
+ dict[@"url"] = fileMsg.url ?: @"";
416
+ dict[@"name"] = fileMsg.name ?: @"";
417
+ dict[@"size"] = @(fileMsg.size);
418
+ dict[@"type"] = fileMsg.type ?: @"";
419
+ dict[@"extra"] = fileMsg.extra ?: @"";
420
+ } else if ([content isKindOfClass:[JVoiceMessage class]]) {
421
+ JVoiceMessage *voiceMsg = (JVoiceMessage *)content;
422
+ dict[@"url"] = voiceMsg.url ?: @"";
423
+ dict[@"localPath"] = voiceMsg.localPath ?: @"";
424
+ dict[@"duration"] = @(voiceMsg.duration);
425
+ dict[@"extra"] = voiceMsg.extra ?: @"";
426
+ }
427
+
428
+ return dict;
429
+ }
430
+
431
+ /**
432
+ * 将消息回应转换为字典
433
+ */
434
+ - (NSDictionary *)convertReactionToDictionary:(JMessageReaction *)reaction {
435
+ NSMutableArray *itemArray = [NSMutableArray array];
436
+
437
+ for (JMessageReactionItem *item in reaction.itemList) {
438
+ NSMutableArray *userArray = [NSMutableArray array];
439
+
440
+ for (JUserInfo *user in item.userInfoList) {
441
+ NSDictionary *userDict = [self convertUserInfoToDictionary:user];
442
+ if (userDict) {
443
+ [userArray addObject:userDict];
444
+ }
445
+ }
446
+
447
+ NSDictionary *itemDict =
448
+ @{@"reactionId" : item.reactionId ?: @"", @"userInfoList" : userArray};
449
+
450
+ [itemArray addObject:itemDict];
451
+ }
452
+
453
+ NSDictionary *reactionDict =
454
+ @{@"messageId" : reaction.messageId ?: @"", @"itemList" : itemArray};
455
+
456
+ return reactionDict;
457
+ }
458
+
459
+ /**
460
+ * 将用户信息转换为字典
461
+ */
462
+ - (NSDictionary *)convertUserInfoToDictionary:(JUserInfo *)userInfo {
463
+ return @{
464
+ @"userId" : userInfo.userId ?: @"",
465
+ @"userName" : userInfo.userName ?: @"",
466
+ @"avatar" : userInfo.portrait ?: @""
467
+ };
468
+ }
469
+
470
+ /**
471
+ * 将@消息信息转换为字典
472
+ */
473
+ - (NSDictionary *)convertMentionInfoToDictionary:(JMessageMentionInfo *)mentionInfo {
474
+ NSMutableDictionary *map = [NSMutableDictionary dictionary];
475
+ map[@"type"] = @(mentionInfo.type);
476
+
477
+ NSMutableArray *userArray = [NSMutableArray array];
478
+ for (JUserInfo *userInfo in mentionInfo.targetUsers) {
479
+ [userArray addObject:[self convertUserInfoToDictionary:userInfo]];
480
+ }
481
+ map[@"targetUsers"] = userArray;
482
+
483
+ return map;
484
+ }
485
+
486
+ /**
487
+ * 将群消息阅读信息转换为字典
488
+ */
489
+ - (NSDictionary *)convertGroupMessageReadInfoToDictionary:
490
+ (JGroupMessageReadInfo *)info {
491
+ return
492
+ @{@"readCount" : @(info.readCount), @"memberCount" : @(info.memberCount)};
493
+ }
494
+
495
+ /**
496
+ * 将会话信息转换为字典
497
+ */
498
+ - (NSDictionary *)convertConversationInfoToDictionary:(JConversationInfo *)info {
499
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
500
+ dict[@"conversation"] = [self convertConversationToDictionary:info.conversation];
501
+ dict[@"unreadCount"] = @(info.unreadCount);
502
+ dict[@"topTime"] = @(info.topTime);
503
+ dict[@"sortTime"] = @(info.sortTime);
504
+ dict[@"isTop"] = @(info.isTop);
505
+ dict[@"isMute"] = @(info.mute);
506
+ dict[@"hasUnread"] = @(info.hasUnread);
507
+ dict[@"draft"] = info.draft ?: @"";
508
+ if (info.lastMessage) {
509
+ dict[@"lastMessage"] = [self convertMessageToDictionary:info.lastMessage];
510
+ }
511
+ if (info.mentionInfo) {
512
+ dict[@"mentionInfo"] = [self convertConversationMentionInfoToDictionary:info.mentionInfo];
513
+ }
514
+ return dict;
515
+ }
516
+
517
+ - (NSDictionary *)convertConversationMentionInfoToDictionary:(JConversationMentionInfo *)mentionInfo {
518
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
519
+ if (mentionInfo.mentionMsgList) {
520
+ NSMutableArray *mentionMsgArray = [NSMutableArray array];
521
+ for (JConversationMentionMessage *mentionMsg in mentionInfo.mentionMsgList) {
522
+ NSDictionary *msgDict = @{
523
+ @"senderId": mentionMsg.senderId ?: @"",
524
+ @"msgId": mentionMsg.msgId ?: @"",
525
+ @"msgTime": @(mentionMsg.msgTime),
526
+ @"type": @(mentionMsg.type)
527
+ };
528
+ [mentionMsgArray addObject:msgDict];
529
+ }
530
+ dict[@"mentionMsgList"] = mentionMsgArray;
531
+ }
532
+ return dict;
533
+ }
534
+
535
+
536
+ #pragma mark - Conversation Methods
537
+
538
+ /**
539
+ * 获取会话列表
540
+ */
541
+ RCT_EXPORT_METHOD(getConversationInfoList:(int)count
542
+ timestamp:(double)timestamp
543
+ pullDirection:(int)pullDirection
544
+ resolver:(RCTPromiseResolveBlock)resolve
545
+ rejecter:(RCTPromiseRejectBlock)reject) {
546
+ JPullDirection direction = 0 == pullDirection ? JPullDirectionNewer : JPullDirectionOlder;
547
+
548
+ NSArray<JConversationInfo *> *conversationInfos = [JIM.shared.conversationManager
549
+ getConversationInfoListByCount:count
550
+ timestamp:timestamp
551
+ direction:direction];
552
+
553
+ NSMutableArray *result = [NSMutableArray array];
554
+ for (JConversationInfo *info in conversationInfos) {
555
+ [result addObject:[self convertConversationInfoToDictionary:info]];
556
+ }
557
+
558
+ resolve(result);
559
+ }
560
+
561
+ /**
562
+ * 获取单个会话信息
563
+ */
564
+ RCT_EXPORT_METHOD(getConversationInfo:(NSDictionary *)conversationMap
565
+ resolver:(RCTPromiseResolveBlock)resolve
566
+ rejecter:(RCTPromiseRejectBlock)reject) {
567
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
568
+
569
+ JConversationInfo *info = [JIM.shared.conversationManager getConversationInfo:conversation];
570
+
571
+ if (info) {
572
+ resolve([self convertConversationInfoToDictionary:info]);
573
+ } else {
574
+ resolve([NSNull null]);
575
+ }
576
+ }
577
+
578
+ /**
579
+ * 创建会话信息
580
+ */
581
+ RCT_EXPORT_METHOD(createConversationInfo:(NSDictionary *)conversationMap
582
+ resolver:(RCTPromiseResolveBlock)resolve
583
+ rejecter:(RCTPromiseRejectBlock)reject) {
584
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
585
+
586
+ [JIM.shared.conversationManager createConversationInfo:conversation
587
+ success:^(JConversationInfo *info) {
588
+ resolve([self convertConversationInfoToDictionary:info]);
589
+ } error:^(JErrorCode code) {
590
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
591
+ }];
592
+ }
593
+
594
+ /**
595
+ * 删除会话信息
596
+ */
597
+ RCT_EXPORT_METHOD(deleteConversationInfo:(NSDictionary *)conversationMap
598
+ resolver:(RCTPromiseResolveBlock)resolve
599
+ rejecter:(RCTPromiseRejectBlock)reject) {
600
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
601
+
602
+ [JIM.shared.conversationManager deleteConversationInfoBy:conversation
603
+ success:^{
604
+ resolve(@YES);
605
+ } error:^(JErrorCode code) {
606
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
607
+ }];
608
+ }
609
+
610
+ /**
611
+ * 设置会话免打扰状态
612
+ */
613
+ RCT_EXPORT_METHOD(setMute:(NSDictionary *)conversationMap
614
+ isMute:(BOOL)isMute
615
+ resolver:(RCTPromiseResolveBlock)resolve
616
+ rejecter:(RCTPromiseRejectBlock)reject) {
617
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
618
+
619
+ [JIM.shared.conversationManager setMute:isMute
620
+ conversation:conversation
621
+ success:^{
622
+ resolve(@YES);
623
+ } error:^(JErrorCode code) {
624
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
625
+ }];
626
+ }
627
+
628
+ /**
629
+ * 设置会话置顶状态
630
+ */
631
+ RCT_EXPORT_METHOD(setTop:(NSDictionary *)conversationMap
632
+ isTop:(BOOL)isTop
633
+ resolver:(RCTPromiseResolveBlock)resolve
634
+ rejecter:(RCTPromiseRejectBlock)reject) {
635
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
636
+
637
+ [JIM.shared.conversationManager setTop:isTop
638
+ conversation:conversation
639
+ success:^{
640
+ resolve(@YES);
641
+ } error:^(JErrorCode code) {
642
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
643
+ }];
644
+ }
645
+
646
+ /**
647
+ * 清除会话未读数
648
+ */
649
+ RCT_EXPORT_METHOD(clearUnreadCount:(NSDictionary *)conversationMap
650
+ resolver:(RCTPromiseResolveBlock)resolve
651
+ rejecter:(RCTPromiseRejectBlock)reject) {
652
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
653
+
654
+ [JIM.shared.conversationManager clearUnreadCountByConversation:conversation
655
+ success:^{
656
+ resolve(@YES);
657
+ } error:^(JErrorCode code) {
658
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
659
+ }];
660
+ }
661
+
662
+ /**
663
+ * 清除总未读数
664
+ */
665
+ RCT_EXPORT_METHOD(clearTotalUnreadCount:(RCTPromiseResolveBlock)resolve
666
+ rejecter:(RCTPromiseRejectBlock)reject) {
667
+ [JIM.shared.conversationManager clearTotalUnreadCount:^{
668
+ resolve(@YES);
669
+ } error:^(JErrorCode code) {
670
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
671
+ }];
672
+ }
673
+
674
+ /**
675
+ * 获取总未读数
676
+ */
677
+ RCT_EXPORT_METHOD(getTotalUnreadCount:(RCTPromiseResolveBlock)resolve
678
+ rejecter:(RCTPromiseRejectBlock)reject) {
679
+ int count = [JIM.shared.conversationManager getTotalUnreadCount];
680
+ resolve(@(count));
681
+ }
682
+
683
+ /**
684
+ * 设置会话草稿
685
+ */
686
+ RCT_EXPORT_METHOD(setDraft:(NSDictionary *)conversationMap
687
+ draft:(NSString *)draft
688
+ resolver:(RCTPromiseResolveBlock)resolve
689
+ rejecter:(RCTPromiseRejectBlock)reject) {
690
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
691
+
692
+ [JIM.shared.conversationManager setDraft:draft inConversation:conversation];
693
+ resolve(@YES);
694
+ }
695
+
696
+ /**
697
+ * 清除会话草稿
698
+ */
699
+ RCT_EXPORT_METHOD(clearDraft:(NSDictionary *)conversationMap
700
+ resolver:(RCTPromiseResolveBlock)resolve
701
+ rejecter:(RCTPromiseRejectBlock)reject) {
702
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
703
+
704
+ [JIM.shared.conversationManager clearDraftInConversation:conversation];
705
+ resolve(@YES);
706
+ }
707
+
708
+ /**
709
+ * 标记会话未读
710
+ */
711
+ RCT_EXPORT_METHOD(setUnread:(NSDictionary *)conversationMap
712
+ resolver:(RCTPromiseResolveBlock)resolve
713
+ rejecter:(RCTPromiseRejectBlock)reject) {
714
+ JConversation *conversation = [self convertDictionaryToConversation:conversationMap];
715
+
716
+ [JIM.shared.conversationManager setUnread:conversation
717
+ success:^{
718
+ resolve(@YES);
719
+ } error:^(JErrorCode code) {
720
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
721
+ }];
722
+ }
723
+
724
+ /**
725
+ * 获取置顶会话列表
726
+ */
727
+ RCT_EXPORT_METHOD(getTopConversationInfoList:(int)count
728
+ timestamp:(long long)timestamp
729
+ pullDirection:(NSString *)pullDirection
730
+ resolver:(RCTPromiseResolveBlock)resolve
731
+ rejecter:(RCTPromiseRejectBlock)reject) {
732
+ JPullDirection direction = [@"up" isEqualToString:pullDirection] ? JPullDirectionNewer : JPullDirectionOlder;
733
+
734
+ NSArray<JConversationInfo *> *conversationInfos = [JIM.shared.conversationManager
735
+ getTopConversationInfoListByCount:count
736
+ timestamp:timestamp
737
+ direction:direction];
738
+
739
+ NSMutableArray *result = [NSMutableArray array];
740
+ for (JConversationInfo *info in conversationInfos) {
741
+ [result addObject:[self convertConversationInfoToDictionary:info]];
742
+ }
743
+
744
+ resolve(result);
745
+ }
746
+
747
+ /**
748
+ * 获取指定类型未读数
749
+ */
750
+ RCT_EXPORT_METHOD(getUnreadCountWithTypes:(NSArray<NSNumber *> *)conversationTypes
751
+ resolver:(RCTPromiseResolveBlock)resolve
752
+ rejecter:(RCTPromiseRejectBlock)reject) {
753
+ int count = [JIM.shared.conversationManager getUnreadCountWithTypes:conversationTypes];
754
+ resolve(@(count));
755
+ }
756
+
757
+ #pragma mark - Conversation Tag Methods
758
+
759
+ /**
760
+ * 向标签添加会话
761
+ */
762
+ RCT_EXPORT_METHOD(addConversationsToTag:(NSArray *)conversationMaps
763
+ tagId:(NSString *)tagId
764
+ resolver:(RCTPromiseResolveBlock)resolve
765
+ rejecter:(RCTPromiseRejectBlock)reject) {
766
+ NSMutableArray<JConversation *> *conversations = [NSMutableArray array];
767
+ for (NSDictionary *conversationMap in conversationMaps) {
768
+ [conversations addObject:[self convertDictionaryToConversation:conversationMap]];
769
+ }
770
+
771
+ [JIM.shared.conversationManager addConversationList:conversations
772
+ toTag:tagId
773
+ success:^{
774
+ resolve(@YES);
775
+ } error:^(JErrorCode code) {
776
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
777
+ }];
778
+ }
779
+
780
+ /**
781
+ * 从标签移除会话
782
+ */
783
+ RCT_EXPORT_METHOD(removeConversationsFromTag:(NSArray *)conversationMaps
784
+ tagId:(NSString *)tagId
785
+ resolver:(RCTPromiseResolveBlock)resolve
786
+ rejecter:(RCTPromiseRejectBlock)reject) {
787
+ NSMutableArray<JConversation *> *conversations = [NSMutableArray array];
788
+ for (NSDictionary *conversationMap in conversationMaps) {
789
+ [conversations addObject:[self convertDictionaryToConversation:conversationMap]];
790
+ }
791
+
792
+ [JIM.shared.conversationManager removeConversationList:conversations
793
+ fromTag:tagId
794
+ success:^{
795
+ resolve(@YES);
796
+ } error:^(JErrorCode code) {
797
+ reject(@"error", [NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
798
+ }];
799
+ }
800
+
801
+ #pragma mark - Helper Methods
802
+
803
+ /**
804
+ * 将字典转换为会话对象
805
+ */
806
+ - (JConversation *)convertDictionaryToConversation:(NSDictionary *)dict {
807
+ JConversationType type = (JConversationType)[dict[@"conversationType"] intValue];
808
+ NSString *conversationId = dict[@"conversationId"];
809
+ return [[JConversation alloc] initWithConversationType:type conversationId:conversationId];
810
+ }
811
+
812
+ /**
813
+ * 发送消息
814
+ */
815
+ RCT_EXPORT_METHOD(sendMessage:(NSDictionary *)messageDict
816
+ messageId:(NSString *)messageId
817
+ resolver:(RCTPromiseResolveBlock)resolve
818
+ rejecter:(RCTPromiseRejectBlock)reject) {
819
+ @try {
820
+ // 构建消息内容和会话对象
821
+ JMessageContent *content = [self convertDictToMessageContent:[messageDict objectForKey:@"content"]];
822
+ JConversation *conversation = [self convertDictionaryToConversation:messageDict];
823
+
824
+ if (!content) {
825
+ reject(@"SEND_MESSAGE_ERROR", @"无效的消息内容", nil);
826
+ return;
827
+ }
828
+
829
+ // 发送消息
830
+ JMessage *message = [JIM.shared.messageManager sendMessage:content
831
+ inConversation:conversation
832
+ success:^(JMessage *message) {
833
+ [self sendEventWithName:@"onMessageSent"
834
+ body:@{
835
+ @"messageId" : messageId,
836
+ @"message" : [self convertMessageToDictionary:message]
837
+ }];
838
+ } error:^(JErrorCode errorCode, JMessage *message) {
839
+ [self sendEventWithName:@"onMessageSentError"
840
+ body:@{
841
+ @"messageId" : messageId,
842
+ @"message" : [self convertMessageToDictionary:message],
843
+ @"errorCode" : @(errorCode)
844
+ }];
845
+ }];
846
+ NSMutableDictionary *result = [self convertMessageToDictionary:message];
847
+ result[@"messageId"] = messageId;
848
+ resolve(result);
849
+ } @catch (NSException *exception) {
850
+ reject(@"SEND_MESSAGE_ERROR", exception.reason, nil);
851
+ }
852
+ }
853
+
854
+ /**
855
+ * 发送图片消息
856
+ */
857
+ RCT_EXPORT_METHOD(sendImageMessage:(NSDictionary *)messageDict
858
+ messageId:(NSString *)messageId
859
+ resolver:(RCTPromiseResolveBlock)resolve
860
+ rejecter:(RCTPromiseRejectBlock)reject) {
861
+ @try {
862
+ JConversation *conversation = [self convertDictionaryToConversation:messageDict];
863
+ JImageMessage *imageMessage = [[JImageMessage alloc] init];
864
+
865
+ NSDictionary *contentDict = messageDict[@"content"];
866
+ if (contentDict[@"localPath"]) {
867
+ imageMessage.localPath = contentDict[@"localPath"];
868
+ }
869
+ if (contentDict[@"thumbnailLocalPath"]) {
870
+ imageMessage.thumbnailLocalPath = contentDict[@"thumbnailLocalPath"];
871
+ }
872
+ if (contentDict[@"url"]) {
873
+ imageMessage.url = contentDict[@"url"];
874
+ }
875
+ if (contentDict[@"thumbnailUrl"]) {
876
+ imageMessage.thumbnailUrl = contentDict[@"thumbnailUrl"];
877
+ }
878
+ if (contentDict[@"width"]) {
879
+ imageMessage.width = [contentDict[@"width"] integerValue];
880
+ }
881
+ if (contentDict[@"height"]) {
882
+ imageMessage.height = [contentDict[@"height"] integerValue];
883
+ }
884
+
885
+ JMessage *message = [JIM.shared.messageManager sendMediaMessage:imageMessage
886
+ inConversation:conversation
887
+ progress:^(int progress, JMessage * _Nonnull message) {
888
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
889
+ params[@"messageId"] = messageId;
890
+ params[@"progress"] = @(progress);
891
+ params[@"message"] = [self convertMessageToDictionary:message];
892
+ [self sendEventWithName:@"onMediaMessageProgress" body:params];
893
+ } success:^(JMessage * _Nonnull message) {
894
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
895
+ params[@"messageId"] = messageId;
896
+ params[@"message"] = [self convertMessageToDictionary:message];
897
+ [self sendEventWithName:@"onMediaMessageSent" body:params];
898
+ } error:^(JErrorCode errorCode, JMessage * _Nonnull message) {
899
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
900
+ params[@"messageId"] = messageId;
901
+ params[@"message"] = [self convertMessageToDictionary:message];
902
+ params[@"errorCode"] = @(errorCode);
903
+ [self sendEventWithName:@"onMediaMessageSentError" body:params];
904
+ } cancel:^(JMessage * _Nonnull message) {
905
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
906
+ params[@"messageId"] = messageId;
907
+ params[@"message"] = [self convertMessageToDictionary:message];
908
+ [self sendEventWithName:@"onMediaMessageCancelled" body:params];
909
+ }];
910
+
911
+ NSMutableDictionary *result = [self convertMessageToDictionary:message];
912
+ result[@"messageId"] = messageId;
913
+ resolve(result);
914
+ } @catch (NSException *exception) {
915
+ reject(@"SEND_IMAGE_MESSAGE_ERROR", exception.reason, nil);
916
+ }
917
+ }
918
+
919
+ /**
920
+ * 发送文件消息
921
+ */
922
+ RCT_EXPORT_METHOD(sendFileMessage:(NSDictionary *)messageDict
923
+ messageId:(NSString *)messageId
924
+ resolver:(RCTPromiseResolveBlock)resolve
925
+ rejecter:(RCTPromiseRejectBlock)reject) {
926
+ @try {
927
+ JConversation *conversation = [self convertDictionaryToConversation:messageDict];
928
+ JFileMessage *fileMessage = [[JFileMessage alloc] init];
929
+
930
+ NSDictionary *contentDict = messageDict[@"content"];
931
+ if (contentDict[@"localPath"]) {
932
+ fileMessage.localPath = contentDict[@"localPath"];
933
+ }
934
+ if (contentDict[@"url"]) {
935
+ fileMessage.url = contentDict[@"url"];
936
+ }
937
+ if (contentDict[@"name"]) {
938
+ fileMessage.name = contentDict[@"name"];
939
+ }
940
+ if (contentDict[@"size"]) {
941
+ fileMessage.size = [contentDict[@"size"] longLongValue];
942
+ }
943
+ if (contentDict[@"type"]) {
944
+ fileMessage.type = contentDict[@"type"];
945
+ }
946
+
947
+ JMessage *message = [JIM.shared.messageManager sendMediaMessage:fileMessage
948
+ inConversation:conversation
949
+ progress:^(int progress, JMessage * _Nonnull message) {
950
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
951
+ params[@"messageId"] = messageId;
952
+ params[@"progress"] = @(progress);
953
+ params[@"message"] = [self convertMessageToDictionary:message];
954
+ [self sendEventWithName:@"onMediaMessageProgress" body:params];
955
+ } success:^(JMessage * _Nonnull message) {
956
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
957
+ params[@"messageId"] = messageId;
958
+ params[@"message"] = [self convertMessageToDictionary:message];
959
+ [self sendEventWithName:@"onMediaMessageSent" body:params];
960
+ } error:^(JErrorCode errorCode, JMessage * _Nonnull message) {
961
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
962
+ params[@"messageId"] = messageId;
963
+ params[@"message"] = [self convertMessageToDictionary:message];
964
+ params[@"errorCode"] = @(errorCode);
965
+ [self sendEventWithName:@"onMediaMessageSentError" body:params];
966
+ } cancel:^(JMessage * _Nonnull message) {
967
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
968
+ params[@"messageId"] = messageId;
969
+ params[@"message"] = [self convertMessageToDictionary:message];
970
+ [self sendEventWithName:@"onMediaMessageCancelled" body:params];
971
+ }];
972
+
973
+ NSMutableDictionary *result = [self convertMessageToDictionary:message];
974
+ result[@"messageId"] = messageId;
975
+ resolve(result);
976
+ } @catch (NSException *exception) {
977
+ reject(@"SEND_FILE_MESSAGE_ERROR", exception.reason, nil);
978
+ }
979
+ }
980
+
981
+ /**
982
+ * 发送语音消息
983
+ */
984
+ RCT_EXPORT_METHOD(sendVoiceMessage:(NSDictionary *)messageDict
985
+ messageId:(NSString *)messageId
986
+ resolver:(RCTPromiseResolveBlock)resolve
987
+ rejecter:(RCTPromiseRejectBlock)reject) {
988
+ @try {
989
+ JConversation *conversation = [self convertDictionaryToConversation:messageDict];
990
+ JVoiceMessage *voiceMessage = [[JVoiceMessage alloc] init];
991
+
992
+ NSDictionary *contentDict = messageDict[@"content"];
993
+ if (contentDict[@"localPath"]) {
994
+ voiceMessage.localPath = contentDict[@"localPath"];
995
+ }
996
+ if (contentDict[@"url"]) {
997
+ voiceMessage.url = contentDict[@"url"];
998
+ }
999
+ if (contentDict[@"duration"]) {
1000
+ voiceMessage.duration = [contentDict[@"duration"] integerValue];
1001
+ }
1002
+
1003
+ JMessage *message = [JIM.shared.messageManager sendMediaMessage:voiceMessage
1004
+ inConversation:conversation
1005
+ progress:^(int progress, JMessage * _Nonnull message) {
1006
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
1007
+ params[@"messageId"] = messageId;
1008
+ params[@"progress"] = @(progress);
1009
+ params[@"message"] = [self convertMessageToDictionary:message];
1010
+ [self sendEventWithName:@"onMediaMessageProgress" body:params];
1011
+ } success:^(JMessage * _Nonnull message) {
1012
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
1013
+ params[@"messageId"] = messageId;
1014
+ params[@"message"] = [self convertMessageToDictionary:message];
1015
+ [self sendEventWithName:@"onMediaMessageSent" body:params];
1016
+ } error:^(JErrorCode errorCode, JMessage * _Nonnull message) {
1017
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
1018
+ params[@"messageId"] = messageId;
1019
+ params[@"message"] = [self convertMessageToDictionary:message];
1020
+ params[@"errorCode"] = @(errorCode);
1021
+ [self sendEventWithName:@"onMediaMessageSentError" body:params];
1022
+ } cancel:^(JMessage * _Nonnull message) {
1023
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
1024
+ params[@"messageId"] = messageId;
1025
+ params[@"message"] = [self convertMessageToDictionary:message];
1026
+ [self sendEventWithName:@"onMediaMessageCancelled" body:params];
1027
+ }];
1028
+
1029
+ NSMutableDictionary *result = [self convertMessageToDictionary:message];
1030
+ result[@"messageId"] = messageId;
1031
+ resolve(result);
1032
+ } @catch (NSException *exception) {
1033
+ reject(@"SEND_VOICE_MESSAGE_ERROR", exception.reason, nil);
1034
+ }
1035
+ }
1036
+
1037
+ /**
1038
+ * 获取历史消息
1039
+ */
1040
+ RCT_EXPORT_METHOD(getMessages:(NSDictionary *)conversationDict
1041
+ direction:(int)direction
1042
+ options:(NSDictionary *)options
1043
+ resolver:(RCTPromiseResolveBlock)resolve
1044
+ rejecter:(RCTPromiseRejectBlock)reject) {
1045
+ @try {
1046
+ JConversation *conversation = [self convertDictionaryToConversation:conversationDict];
1047
+ JGetMessageOptions *getOptions = [[JGetMessageOptions alloc] init];
1048
+
1049
+ if (options[@"count"]) {
1050
+ getOptions.count = [options[@"count"] integerValue];
1051
+ }
1052
+ if (options[@"startTime"]) {
1053
+ getOptions.startTime = [options[@"startTime"] longLongValue];
1054
+ }
1055
+
1056
+ JPullDirection pullDirection = direction == 0 ? JPullDirectionOlder : JPullDirectionNewer;
1057
+
1058
+ [JIM.shared.messageManager getMessages:conversation
1059
+ direction:pullDirection
1060
+ option:getOptions
1061
+ complete:^(NSArray<JMessage *> *messages, long long timestamp, BOOL hasMore, JErrorCode code) {
1062
+ NSMutableArray *messageArray = [NSMutableArray array];
1063
+ for (JMessage *msg in messages) {
1064
+ [messageArray addObject:[self convertMessageToDictionary:msg]];
1065
+ }
1066
+ NSLog(@"getMessages complete: %lu messages, timestamp: %lld, hasMore: %d, code: %ld",
1067
+ (unsigned long)messages.count, timestamp, hasMore, (long)code);
1068
+ NSDictionary *result = @{
1069
+ @"messages": messageArray,
1070
+ @"timestamp": @(timestamp),
1071
+ @"hasMore": @(hasMore),
1072
+ @"code": @(code)
1073
+ };
1074
+
1075
+ resolve(result);
1076
+ }];
1077
+ } @catch (NSException *exception) {
1078
+ reject(@"GET_MESSAGES_ERROR", exception.reason, nil);
1079
+ }
1080
+ }
1081
+
1082
+ /**
1083
+ * 撤回消息
1084
+ */
1085
+ RCT_EXPORT_METHOD(recallMessage:(NSDictionary *)messageDict
1086
+ extras:(NSDictionary *)extras
1087
+ resolver:(RCTPromiseResolveBlock)resolve
1088
+ rejecter:(RCTPromiseRejectBlock)reject) {
1089
+ @try {
1090
+ NSString *messageId = messageDict[@"messageId"];
1091
+ NSDictionary *extrasDict = extras ?: @{};
1092
+
1093
+ [JIM.shared.messageManager recallMessage:messageId
1094
+ extras:extrasDict
1095
+ success:^(JMessage *message){
1096
+ resolve(@YES);
1097
+ } error:^(JErrorCode errorCode) {
1098
+ reject(@"RECALL_MESSAGE_ERROR", @"撤回消息失败", [NSError errorWithDomain:@"JuggleIM" code:errorCode userInfo:nil]);
1099
+ }];
1100
+ } @catch (NSException *exception) {
1101
+ reject(@"RECALL_MESSAGE_ERROR", exception.reason, nil);
1102
+ }
1103
+ }
1104
+
1105
+ /**
1106
+ * 添加消息反应
1107
+ */
1108
+ RCT_EXPORT_METHOD(addMessageReaction:(NSDictionary *)messageDict
1109
+ reactionId:(NSString *)reactionId
1110
+ resolver:(RCTPromiseResolveBlock)resolve
1111
+ rejecter:(RCTPromiseRejectBlock)reject) {
1112
+ @try {
1113
+ NSString *messageId = messageDict[@"messageId"];
1114
+ JConversation *conversation = [self convertDictionaryToConversation:messageDict];
1115
+
1116
+ [JIM.shared.messageManager addMessageReaction:messageId
1117
+ conversation:conversation
1118
+ reactionId:reactionId
1119
+ success:^{
1120
+ resolve(@YES);
1121
+ } error:^(JErrorCode errorCode) {
1122
+ reject(@"ADD_REACTION_ERROR", @"添加反应失败", [NSError errorWithDomain:@"JuggleIM" code:errorCode userInfo:nil]);
1123
+ }];
1124
+ } @catch (NSException *exception) {
1125
+ reject(@"ADD_REACTION_ERROR", exception.reason, nil);
1126
+ }
1127
+ }
1128
+
1129
+ /**
1130
+ * 移除消息反应
1131
+ */
1132
+ RCT_EXPORT_METHOD(removeMessageReaction:(NSDictionary *)messageDict
1133
+ reactionId:(NSString *)reactionId
1134
+ resolver:(RCTPromiseResolveBlock)resolve
1135
+ rejecter:(RCTPromiseRejectBlock)reject) {
1136
+ @try {
1137
+ NSString *messageId = messageDict[@"messageId"];
1138
+ JConversation *conversation = [self convertDictionaryToConversation:messageDict];
1139
+
1140
+ [JIM.shared.messageManager removeMessageReaction:messageId
1141
+ conversation:conversation
1142
+ reactionId:reactionId
1143
+ success:^{
1144
+ resolve(@YES);
1145
+ } error:^(JErrorCode errorCode) {
1146
+ reject(@"REMOVE_REACTION_ERROR", @"移除反应失败", [NSError errorWithDomain:@"JuggleIM" code:errorCode userInfo:nil]);
1147
+ }];
1148
+ } @catch (NSException *exception) {
1149
+ reject(@"REMOVE_REACTION_ERROR", exception.reason, nil);
1150
+ }
1151
+ }
1152
+
1153
+ // 辅助方法:将字典转换为消息内容
1154
+ - (JMessageContent *)convertDictToMessageContent:(NSDictionary *)messageDict {
1155
+ NSString *contentType = messageDict[@"contentType"];
1156
+
1157
+ if ([contentType isEqualToString:@"jg:text"]) {
1158
+ JTextMessage *text = [[JTextMessage alloc] initWithContent:messageDict[@"content"] ?: @""];
1159
+ return text;
1160
+ } else if ([contentType isEqualToString:@"jg:img"]) {
1161
+ JImageMessage *img = [[JImageMessage alloc] init];
1162
+ img.url = messageDict[@"url"];
1163
+ img.localPath = messageDict[@"localPath"];
1164
+ img.thumbnailLocalPath = messageDict[@"thumbnailLocalPath"];
1165
+ img.thumbnailUrl = messageDict[@"thumbnailUrl"];
1166
+ img.width = [messageDict[@"width"] integerValue];
1167
+ img.height = [messageDict[@"height"] integerValue];
1168
+ return img;
1169
+ } else if ([contentType isEqualToString:@"jg:file"]) {
1170
+ JFileMessage *file = [[JFileMessage alloc] init];
1171
+ file.url = messageDict[@"url"];
1172
+ file.type = messageDict[@"type"];
1173
+ file.name = messageDict[@"name"];
1174
+ file.size = [messageDict[@"size"] longLongValue];
1175
+ return file;
1176
+ } else if ([contentType isEqualToString:@"jg:voice"]) {
1177
+ JVoiceMessage *voice = [[JVoiceMessage alloc] init];
1178
+ voice.url = messageDict[@"url"];
1179
+ voice.localPath = messageDict[@"localPath"];
1180
+ voice.duration = [messageDict[@"duration"] integerValue];
1181
+ return voice;
1182
+ }
1183
+
1184
+ return nil;
1185
+ }
1186
+ @end