juggleim-rnsdk 0.0.15 → 0.0.17
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/src/main/java/com/juggleim/JuggleIMManager.java +35 -1
- package/ios/JuggleIMManager.m +610 -514
- package/package.json +1 -1
- package/src/index.d.ts +26 -21
- package/src/index.js +14 -5
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
- package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/caches/deviceStreaming.xml +0 -981
- package/android/.idea/gradle.xml +0 -12
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/build/.transforms/1525b0d13d9826ed3233f1973214d849/results.bin +0 -1
- package/android/build/.transforms/1525b0d13d9826ed3233f1973214d849/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/32937366d2d155289e73cba3894468b5/results.bin +0 -1
- package/android/build/.transforms/32937366d2d155289e73cba3894468b5/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/results.bin +0 -1
- package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
- package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
- package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
- package/android/build/.transforms/3836873630d52928fb1c95f4a42a08c2/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/4ae221a259570a6033b0069041b5796d/results.bin +0 -1
- package/android/build/.transforms/4ae221a259570a6033b0069041b5796d/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/results.bin +0 -1
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/FileUtils.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$1.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$10.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$11.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$12.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$13.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$14.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$15.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$16.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$17.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$18.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$2.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$3.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$4.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$5.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$6.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$7.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$8.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$9.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/RNTypeConverter$1.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/RNTypeConverter.dex +0 -0
- package/android/build/.transforms/5a7ea9416fd710e97c2bb8d5954b2c2c/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/results.bin +0 -1
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$1.dex +0 -0
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$2.dex +0 -0
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
- package/android/build/.transforms/85a2c003bf85108f4351f2cf87e94301/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/results.bin +0 -1
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/BuildConfig.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/FileUtils.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$1.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$10.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$11.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$12.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$13.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$14.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$15.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$16.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$17.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$18.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$2.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$3.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$4.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$5.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$6.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$7.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$8.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager$9.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMManager.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/JuggleIMPackage.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/RNTypeConverter$1.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/juggleim/RNTypeConverter.dex +0 -0
- package/android/build/.transforms/9a2afda83c396e5ec45393e60e403432/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/c196b8eedd9d5b3ab65791cf668fe454/results.bin +0 -1
- package/android/build/.transforms/c196b8eedd9d5b3ab65791cf668fe454/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/juggleim/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -9
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1958
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/juggleim/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/FileUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$10.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$11.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$12.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$13.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$14.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$15.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$16.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$17.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$18.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$5.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$6.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$7.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$8.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager$9.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/JuggleIMPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/RNTypeConverter$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/juggleim/RNTypeConverter.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/FileUtils.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$10.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$11.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$12.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$13.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$14.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$15.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$16.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$17.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$18.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$3.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$4.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$5.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$6.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$7.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$8.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager$9.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMManager.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/JuggleIMPackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/RNTypeConverter$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/juggleim/RNTypeConverter.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -11
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -9
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/FileUtils.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$10.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$11.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$12.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$13.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$14.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$15.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$16.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$17.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$18.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$6.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$7.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$8.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager$9.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/JuggleIMPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/RNTypeConverter$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/juggleim/RNTypeConverter.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1450
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
- package/android/build/reports/problems/problems-report.html +0 -663
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$1.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$10.class.uniqueId6 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$11.class.uniqueId11 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$12.class.uniqueId13 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$13.class.uniqueId16 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$14.class.uniqueId5 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$15.class.uniqueId8 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$16.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$17.class.uniqueId20 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$18.class.uniqueId12 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$2.class.uniqueId4 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$3.class.uniqueId7 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$4.class.uniqueId14 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$5.class.uniqueId19 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$6.class.uniqueId18 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$7.class.uniqueId10 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$8.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager$9.class.uniqueId17 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/JuggleIMManager.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNTypeConverter$1.class.uniqueId9 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNTypeConverter.class.uniqueId15 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
package/ios/JuggleIMManager.m
CHANGED
|
@@ -28,16 +28,36 @@ RCT_EXPORT_METHOD(connectWithToken : (NSString *)token) {
|
|
|
28
28
|
[JIM.shared.connectionManager connectWithToken:token];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
RCT_EXPORT_METHOD(disconnect : (BOOL)pushable) {
|
|
32
|
+
[JIM.shared.connectionManager disconnect:pushable];
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
- (NSArray<NSString *> *)supportedEvents {
|
|
32
36
|
return @[
|
|
33
|
-
@"ConnectionStatusChanged",
|
|
34
|
-
@"
|
|
35
|
-
@"
|
|
36
|
-
@"
|
|
37
|
-
@"
|
|
38
|
-
@"
|
|
39
|
-
@"
|
|
40
|
-
@"
|
|
37
|
+
@"ConnectionStatusChanged",
|
|
38
|
+
@"DbDidOpen",
|
|
39
|
+
@"DbDidClose",
|
|
40
|
+
@"MessageReceived",
|
|
41
|
+
@"MessageRecalled",
|
|
42
|
+
@"MessageUpdated",
|
|
43
|
+
@"MessageDeleted",
|
|
44
|
+
@"MessageCleared",
|
|
45
|
+
@"MessageReactionAdded",
|
|
46
|
+
@"MessageReactionRemoved",
|
|
47
|
+
@"MessageSetTop",
|
|
48
|
+
@"MessagesRead",
|
|
49
|
+
@"GroupMessagesRead",
|
|
50
|
+
@"MessageDestroyTimeUpdated",
|
|
51
|
+
@"ConversationInfoAdded",
|
|
52
|
+
@"ConversationInfoUpdated",
|
|
53
|
+
@"ConversationInfoDeleted",
|
|
54
|
+
@"TotalUnreadMessageCountUpdated",
|
|
55
|
+
@"onMessageSent",
|
|
56
|
+
@"onMessageSentError",
|
|
57
|
+
@"onMediaMessageProgress",
|
|
58
|
+
@"onMediaMessageSent",
|
|
59
|
+
@"onMediaMessageSentError",
|
|
60
|
+
@"onMediaMessageCancelled"
|
|
41
61
|
];
|
|
42
62
|
}
|
|
43
63
|
|
|
@@ -340,39 +360,43 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
340
360
|
- (NSDictionary *)convertMessageToDictionary:(JMessage *)message {
|
|
341
361
|
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
|
342
362
|
dict[@"messageId"] = message.messageId ?: @"";
|
|
343
|
-
dict[@"clientMsgNo"] =
|
|
363
|
+
dict[@"clientMsgNo"] =
|
|
364
|
+
[NSString stringWithFormat:@"%lld", message.clientMsgNo];
|
|
344
365
|
dict[@"timestamp"] = @(message.timestamp);
|
|
345
366
|
dict[@"senderUserId"] = message.senderUserId ?: @"";
|
|
346
367
|
dict[@"conversation"] =
|
|
347
368
|
[self convertConversationToDictionary:message.conversation];
|
|
348
369
|
dict[@"content"] = [self convertMessageContentToDictionary:message.content];
|
|
349
370
|
dict[@"direction"] = @(message.direction);
|
|
350
|
-
|
|
371
|
+
dict[@"messageState"] = @(message.messageState);
|
|
351
372
|
|
|
352
373
|
// 添加是否已读
|
|
353
374
|
dict[@"hasRead"] = @(message.hasRead);
|
|
354
|
-
|
|
375
|
+
|
|
355
376
|
// 添加群消息阅读信息
|
|
356
377
|
if (message.groupReadInfo) {
|
|
357
|
-
|
|
378
|
+
dict[@"groupMessageReadInfo"] =
|
|
379
|
+
[self convertGroupMessageReadInfoToDictionary:message.groupReadInfo];
|
|
358
380
|
}
|
|
359
|
-
|
|
381
|
+
|
|
360
382
|
// 添加引用消息
|
|
361
383
|
if (message.referredMsg) {
|
|
362
|
-
|
|
384
|
+
dict[@"referredMessage"] =
|
|
385
|
+
[self convertMessageToDictionary:message.referredMsg];
|
|
363
386
|
}
|
|
364
|
-
|
|
387
|
+
|
|
365
388
|
// 添加@消息信息
|
|
366
389
|
if (message.mentionInfo) {
|
|
367
|
-
|
|
390
|
+
dict[@"mentionInfo"] =
|
|
391
|
+
[self convertMentionInfoToDictionary:message.mentionInfo];
|
|
368
392
|
}
|
|
369
|
-
|
|
393
|
+
|
|
370
394
|
// 添加本地属性
|
|
371
395
|
dict[@"localAttribute"] = message.localAttribute ?: @"";
|
|
372
|
-
|
|
396
|
+
|
|
373
397
|
// 添加是否删除
|
|
374
398
|
dict[@"isDelete"] = @(message.isDeleted);
|
|
375
|
-
|
|
399
|
+
|
|
376
400
|
// 添加是否编辑
|
|
377
401
|
dict[@"isEdit"] = @(message.isEdit);
|
|
378
402
|
|
|
@@ -470,17 +494,18 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
470
494
|
/**
|
|
471
495
|
* 将@消息信息转换为字典
|
|
472
496
|
*/
|
|
473
|
-
- (NSDictionary *)convertMentionInfoToDictionary:
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
497
|
+
- (NSDictionary *)convertMentionInfoToDictionary:
|
|
498
|
+
(JMessageMentionInfo *)mentionInfo {
|
|
499
|
+
NSMutableDictionary *map = [NSMutableDictionary dictionary];
|
|
500
|
+
map[@"type"] = @(mentionInfo.type);
|
|
501
|
+
|
|
502
|
+
NSMutableArray *userArray = [NSMutableArray array];
|
|
503
|
+
for (JUserInfo *userInfo in mentionInfo.targetUsers) {
|
|
504
|
+
[userArray addObject:[self convertUserInfoToDictionary:userInfo]];
|
|
505
|
+
}
|
|
506
|
+
map[@"targetUsers"] = userArray;
|
|
507
|
+
|
|
508
|
+
return map;
|
|
484
509
|
}
|
|
485
510
|
|
|
486
511
|
/**
|
|
@@ -495,9 +520,11 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
495
520
|
/**
|
|
496
521
|
* 将会话信息转换为字典
|
|
497
522
|
*/
|
|
498
|
-
- (NSDictionary *)convertConversationInfoToDictionary:
|
|
523
|
+
- (NSDictionary *)convertConversationInfoToDictionary:
|
|
524
|
+
(JConversationInfo *)info {
|
|
499
525
|
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
|
500
|
-
dict[@"conversation"] =
|
|
526
|
+
dict[@"conversation"] =
|
|
527
|
+
[self convertConversationToDictionary:info.conversation];
|
|
501
528
|
dict[@"unreadCount"] = @(info.unreadCount);
|
|
502
529
|
dict[@"topTime"] = @(info.topTime);
|
|
503
530
|
dict[@"sortTime"] = @(info.sortTime);
|
|
@@ -509,21 +536,24 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
509
536
|
dict[@"lastMessage"] = [self convertMessageToDictionary:info.lastMessage];
|
|
510
537
|
}
|
|
511
538
|
if (info.mentionInfo) {
|
|
512
|
-
dict[@"mentionInfo"] =
|
|
539
|
+
dict[@"mentionInfo"] =
|
|
540
|
+
[self convertConversationMentionInfoToDictionary:info.mentionInfo];
|
|
513
541
|
}
|
|
514
542
|
return dict;
|
|
515
543
|
}
|
|
516
544
|
|
|
517
|
-
- (NSDictionary *)convertConversationMentionInfoToDictionary:
|
|
545
|
+
- (NSDictionary *)convertConversationMentionInfoToDictionary:
|
|
546
|
+
(JConversationMentionInfo *)mentionInfo {
|
|
518
547
|
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
|
519
548
|
if (mentionInfo.mentionMsgList) {
|
|
520
549
|
NSMutableArray *mentionMsgArray = [NSMutableArray array];
|
|
521
|
-
for (JConversationMentionMessage *mentionMsg in mentionInfo
|
|
550
|
+
for (JConversationMentionMessage *mentionMsg in mentionInfo
|
|
551
|
+
.mentionMsgList) {
|
|
522
552
|
NSDictionary *msgDict = @{
|
|
523
|
-
@"senderId": mentionMsg.senderId ?: @"",
|
|
524
|
-
@"msgId": mentionMsg.msgId ?: @"",
|
|
525
|
-
@"msgTime": @(mentionMsg.msgTime),
|
|
526
|
-
@"type": @(mentionMsg.type)
|
|
553
|
+
@"senderId" : mentionMsg.senderId ?: @"",
|
|
554
|
+
@"msgId" : mentionMsg.msgId ?: @"",
|
|
555
|
+
@"msgTime" : @(mentionMsg.msgTime),
|
|
556
|
+
@"type" : @(mentionMsg.type)
|
|
527
557
|
};
|
|
528
558
|
[mentionMsgArray addObject:msgDict];
|
|
529
559
|
}
|
|
@@ -532,42 +562,43 @@ RCT_EXPORT_METHOD(addConversationDelegate) {
|
|
|
532
562
|
return dict;
|
|
533
563
|
}
|
|
534
564
|
|
|
535
|
-
|
|
536
565
|
#pragma mark - Conversation Methods
|
|
537
566
|
|
|
538
567
|
/**
|
|
539
568
|
* 获取会话列表
|
|
540
569
|
*/
|
|
541
|
-
RCT_EXPORT_METHOD(getConversationInfoList:(int)count
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
NSArray<JConversationInfo *> *conversationInfos =
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
570
|
+
RCT_EXPORT_METHOD(getConversationInfoList : (int)count timestamp : (double)
|
|
571
|
+
timestamp pullDirection : (int)pullDirection resolver : (
|
|
572
|
+
RCTPromiseResolveBlock)
|
|
573
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
574
|
+
JPullDirection direction =
|
|
575
|
+
0 == pullDirection ? JPullDirectionNewer : JPullDirectionOlder;
|
|
576
|
+
|
|
577
|
+
NSArray<JConversationInfo *> *conversationInfos =
|
|
578
|
+
[JIM.shared.conversationManager getConversationInfoListByCount:count
|
|
579
|
+
timestamp:timestamp
|
|
580
|
+
direction:direction];
|
|
581
|
+
|
|
553
582
|
NSMutableArray *result = [NSMutableArray array];
|
|
554
583
|
for (JConversationInfo *info in conversationInfos) {
|
|
555
584
|
[result addObject:[self convertConversationInfoToDictionary:info]];
|
|
556
585
|
}
|
|
557
|
-
|
|
586
|
+
|
|
558
587
|
resolve(result);
|
|
559
588
|
}
|
|
560
589
|
|
|
561
590
|
/**
|
|
562
591
|
* 获取单个会话信息
|
|
563
592
|
*/
|
|
564
|
-
RCT_EXPORT_METHOD(getConversationInfo:(NSDictionary *)
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
JConversation *conversation =
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
593
|
+
RCT_EXPORT_METHOD(getConversationInfo : (NSDictionary *)
|
|
594
|
+
conversationMap resolver : (RCTPromiseResolveBlock)
|
|
595
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
596
|
+
JConversation *conversation =
|
|
597
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
598
|
+
|
|
599
|
+
JConversationInfo *info =
|
|
600
|
+
[JIM.shared.conversationManager getConversationInfo:conversation];
|
|
601
|
+
|
|
571
602
|
if (info) {
|
|
572
603
|
resolve([self convertConversationInfoToDictionary:info]);
|
|
573
604
|
} else {
|
|
@@ -578,104 +609,120 @@ RCT_EXPORT_METHOD(getConversationInfo:(NSDictionary *)conversationMap
|
|
|
578
609
|
/**
|
|
579
610
|
* 创建会话信息
|
|
580
611
|
*/
|
|
581
|
-
RCT_EXPORT_METHOD(createConversationInfo:(NSDictionary *)
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
JConversation *conversation =
|
|
585
|
-
|
|
612
|
+
RCT_EXPORT_METHOD(createConversationInfo : (NSDictionary *)
|
|
613
|
+
conversationMap resolver : (RCTPromiseResolveBlock)
|
|
614
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
615
|
+
JConversation *conversation =
|
|
616
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
617
|
+
|
|
586
618
|
[JIM.shared.conversationManager createConversationInfo:conversation
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
619
|
+
success:^(JConversationInfo *info) {
|
|
620
|
+
resolve([self convertConversationInfoToDictionary:info]);
|
|
621
|
+
}
|
|
622
|
+
error:^(JErrorCode code) {
|
|
623
|
+
reject(@"error",
|
|
624
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
625
|
+
}];
|
|
592
626
|
}
|
|
593
627
|
|
|
594
628
|
/**
|
|
595
629
|
* 删除会话信息
|
|
596
630
|
*/
|
|
597
|
-
RCT_EXPORT_METHOD(deleteConversationInfo:(NSDictionary *)
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
JConversation *conversation =
|
|
601
|
-
|
|
631
|
+
RCT_EXPORT_METHOD(deleteConversationInfo : (NSDictionary *)
|
|
632
|
+
conversationMap resolver : (RCTPromiseResolveBlock)
|
|
633
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
634
|
+
JConversation *conversation =
|
|
635
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
636
|
+
|
|
602
637
|
[JIM.shared.conversationManager deleteConversationInfoBy:conversation
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
638
|
+
success:^{
|
|
639
|
+
resolve(@YES);
|
|
640
|
+
}
|
|
641
|
+
error:^(JErrorCode code) {
|
|
642
|
+
reject(@"error",
|
|
643
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
644
|
+
}];
|
|
608
645
|
}
|
|
609
646
|
|
|
610
647
|
/**
|
|
611
648
|
* 设置会话免打扰状态
|
|
612
649
|
*/
|
|
613
|
-
RCT_EXPORT_METHOD(setMute:(NSDictionary *)conversationMap
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
650
|
+
RCT_EXPORT_METHOD(setMute : (NSDictionary *)conversationMap isMute : (BOOL)
|
|
651
|
+
isMute resolver : (RCTPromiseResolveBlock)
|
|
652
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
653
|
+
JConversation *conversation =
|
|
654
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
655
|
+
|
|
619
656
|
[JIM.shared.conversationManager setMute:isMute
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
657
|
+
conversation:conversation
|
|
658
|
+
success:^{
|
|
659
|
+
resolve(@YES);
|
|
660
|
+
}
|
|
661
|
+
error:^(JErrorCode code) {
|
|
662
|
+
reject(@"error",
|
|
663
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
664
|
+
}];
|
|
626
665
|
}
|
|
627
666
|
|
|
628
667
|
/**
|
|
629
668
|
* 设置会话置顶状态
|
|
630
669
|
*/
|
|
631
|
-
RCT_EXPORT_METHOD(setTop:(NSDictionary *)conversationMap
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
670
|
+
RCT_EXPORT_METHOD(setTop : (NSDictionary *)conversationMap isTop : (BOOL)
|
|
671
|
+
isTop resolver : (RCTPromiseResolveBlock)
|
|
672
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
673
|
+
JConversation *conversation =
|
|
674
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
675
|
+
|
|
637
676
|
[JIM.shared.conversationManager setTop:isTop
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
677
|
+
conversation:conversation
|
|
678
|
+
success:^{
|
|
679
|
+
resolve(@YES);
|
|
680
|
+
}
|
|
681
|
+
error:^(JErrorCode code) {
|
|
682
|
+
reject(@"error",
|
|
683
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
684
|
+
}];
|
|
644
685
|
}
|
|
645
686
|
|
|
646
687
|
/**
|
|
647
688
|
* 清除会话未读数
|
|
648
689
|
*/
|
|
649
|
-
RCT_EXPORT_METHOD(clearUnreadCount:(NSDictionary *)
|
|
650
|
-
|
|
651
|
-
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
652
|
-
JConversation *conversation =
|
|
653
|
-
|
|
690
|
+
RCT_EXPORT_METHOD(clearUnreadCount : (NSDictionary *)
|
|
691
|
+
conversationMap resolver : (RCTPromiseResolveBlock)
|
|
692
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
693
|
+
JConversation *conversation =
|
|
694
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
695
|
+
|
|
654
696
|
[JIM.shared.conversationManager clearUnreadCountByConversation:conversation
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
697
|
+
success:^{
|
|
698
|
+
resolve(@YES);
|
|
699
|
+
}
|
|
700
|
+
error:^(JErrorCode code) {
|
|
701
|
+
reject(@"error",
|
|
702
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
703
|
+
}];
|
|
660
704
|
}
|
|
661
705
|
|
|
662
706
|
/**
|
|
663
707
|
* 清除总未读数
|
|
664
708
|
*/
|
|
665
|
-
RCT_EXPORT_METHOD(clearTotalUnreadCount:(RCTPromiseResolveBlock)
|
|
666
|
-
|
|
667
|
-
[JIM.shared.conversationManager
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
709
|
+
RCT_EXPORT_METHOD(clearTotalUnreadCount : (RCTPromiseResolveBlock)
|
|
710
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
711
|
+
[JIM.shared.conversationManager
|
|
712
|
+
clearTotalUnreadCount:^{
|
|
713
|
+
resolve(@YES);
|
|
714
|
+
}
|
|
715
|
+
error:^(JErrorCode code) {
|
|
716
|
+
reject(@"error",
|
|
717
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
718
|
+
}];
|
|
672
719
|
}
|
|
673
720
|
|
|
674
721
|
/**
|
|
675
722
|
* 获取总未读数
|
|
676
723
|
*/
|
|
677
|
-
RCT_EXPORT_METHOD(getTotalUnreadCount:(RCTPromiseResolveBlock)
|
|
678
|
-
|
|
724
|
+
RCT_EXPORT_METHOD(getTotalUnreadCount : (RCTPromiseResolveBlock)
|
|
725
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
679
726
|
int count = [JIM.shared.conversationManager getTotalUnreadCount];
|
|
680
727
|
resolve(@(count));
|
|
681
728
|
}
|
|
@@ -683,12 +730,12 @@ RCT_EXPORT_METHOD(getTotalUnreadCount:(RCTPromiseResolveBlock)resolve
|
|
|
683
730
|
/**
|
|
684
731
|
* 设置会话草稿
|
|
685
732
|
*/
|
|
686
|
-
RCT_EXPORT_METHOD(setDraft:(NSDictionary *)conversationMap
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
733
|
+
RCT_EXPORT_METHOD(setDraft : (NSDictionary *)conversationMap draft : (
|
|
734
|
+
NSString *)draft resolver : (RCTPromiseResolveBlock)
|
|
735
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
736
|
+
JConversation *conversation =
|
|
737
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
738
|
+
|
|
692
739
|
[JIM.shared.conversationManager setDraft:draft inConversation:conversation];
|
|
693
740
|
resolve(@YES);
|
|
694
741
|
}
|
|
@@ -696,11 +743,11 @@ RCT_EXPORT_METHOD(setDraft:(NSDictionary *)conversationMap
|
|
|
696
743
|
/**
|
|
697
744
|
* 清除会话草稿
|
|
698
745
|
*/
|
|
699
|
-
RCT_EXPORT_METHOD(clearDraft:(NSDictionary *)conversationMap
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
746
|
+
RCT_EXPORT_METHOD(clearDraft : (NSDictionary *)conversationMap resolver : (
|
|
747
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
748
|
+
JConversation *conversation =
|
|
749
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
750
|
+
|
|
704
751
|
[JIM.shared.conversationManager clearDraftInConversation:conversation];
|
|
705
752
|
resolve(@YES);
|
|
706
753
|
}
|
|
@@ -708,49 +755,54 @@ RCT_EXPORT_METHOD(clearDraft:(NSDictionary *)conversationMap
|
|
|
708
755
|
/**
|
|
709
756
|
* 标记会话未读
|
|
710
757
|
*/
|
|
711
|
-
RCT_EXPORT_METHOD(setUnread:(NSDictionary *)conversationMap
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
758
|
+
RCT_EXPORT_METHOD(setUnread : (NSDictionary *)conversationMap resolver : (
|
|
759
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
760
|
+
JConversation *conversation =
|
|
761
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
762
|
+
|
|
716
763
|
[JIM.shared.conversationManager setUnread:conversation
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
764
|
+
success:^{
|
|
765
|
+
resolve(@YES);
|
|
766
|
+
}
|
|
767
|
+
error:^(JErrorCode code) {
|
|
768
|
+
reject(@"error",
|
|
769
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
770
|
+
}];
|
|
722
771
|
}
|
|
723
772
|
|
|
724
773
|
/**
|
|
725
774
|
* 获取置顶会话列表
|
|
726
775
|
*/
|
|
727
|
-
RCT_EXPORT_METHOD(getTopConversationInfoList:(int)count
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
776
|
+
RCT_EXPORT_METHOD(getTopConversationInfoList : (int)count timestamp : (
|
|
777
|
+
long long)timestamp pullDirection : (NSString *)
|
|
778
|
+
pullDirection resolver : (RCTPromiseResolveBlock)
|
|
779
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
780
|
+
JPullDirection direction = [@"up" isEqualToString:pullDirection]
|
|
781
|
+
? JPullDirectionNewer
|
|
782
|
+
: JPullDirectionOlder;
|
|
783
|
+
|
|
784
|
+
NSArray<JConversationInfo *> *conversationInfos =
|
|
785
|
+
[JIM.shared.conversationManager
|
|
786
|
+
getTopConversationInfoListByCount:count
|
|
787
|
+
timestamp:timestamp
|
|
788
|
+
direction:direction];
|
|
789
|
+
|
|
739
790
|
NSMutableArray *result = [NSMutableArray array];
|
|
740
791
|
for (JConversationInfo *info in conversationInfos) {
|
|
741
792
|
[result addObject:[self convertConversationInfoToDictionary:info]];
|
|
742
793
|
}
|
|
743
|
-
|
|
794
|
+
|
|
744
795
|
resolve(result);
|
|
745
796
|
}
|
|
746
797
|
|
|
747
798
|
/**
|
|
748
799
|
* 获取指定类型未读数
|
|
749
800
|
*/
|
|
750
|
-
RCT_EXPORT_METHOD(getUnreadCountWithTypes:(NSArray<NSNumber *> *)
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
int count = [JIM.shared.conversationManager
|
|
801
|
+
RCT_EXPORT_METHOD(getUnreadCountWithTypes : (NSArray<NSNumber *> *)
|
|
802
|
+
conversationTypes resolver : (RCTPromiseResolveBlock)
|
|
803
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
804
|
+
int count = [JIM.shared.conversationManager
|
|
805
|
+
getUnreadCountWithTypes:conversationTypes];
|
|
754
806
|
resolve(@(count));
|
|
755
807
|
}
|
|
756
808
|
|
|
@@ -759,43 +811,48 @@ RCT_EXPORT_METHOD(getUnreadCountWithTypes:(NSArray<NSNumber *> *)conversationTyp
|
|
|
759
811
|
/**
|
|
760
812
|
* 向标签添加会话
|
|
761
813
|
*/
|
|
762
|
-
RCT_EXPORT_METHOD(addConversationsToTag:(NSArray *)conversationMaps
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
814
|
+
RCT_EXPORT_METHOD(addConversationsToTag : (NSArray *)conversationMaps tagId : (
|
|
815
|
+
NSString *)tagId resolver : (RCTPromiseResolveBlock)
|
|
816
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
766
817
|
NSMutableArray<JConversation *> *conversations = [NSMutableArray array];
|
|
767
818
|
for (NSDictionary *conversationMap in conversationMaps) {
|
|
768
|
-
[conversations
|
|
819
|
+
[conversations
|
|
820
|
+
addObject:[self convertDictionaryToConversation:conversationMap]];
|
|
769
821
|
}
|
|
770
|
-
|
|
822
|
+
|
|
771
823
|
[JIM.shared.conversationManager addConversationList:conversations
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
824
|
+
toTag:tagId
|
|
825
|
+
success:^{
|
|
826
|
+
resolve(@YES);
|
|
827
|
+
}
|
|
828
|
+
error:^(JErrorCode code) {
|
|
829
|
+
reject(@"error",
|
|
830
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
831
|
+
}];
|
|
778
832
|
}
|
|
779
833
|
|
|
780
834
|
/**
|
|
781
835
|
* 从标签移除会话
|
|
782
836
|
*/
|
|
783
|
-
RCT_EXPORT_METHOD(removeConversationsFromTag:(NSArray *)
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
837
|
+
RCT_EXPORT_METHOD(removeConversationsFromTag : (NSArray *)
|
|
838
|
+
conversationMaps tagId : (NSString *)tagId resolver : (
|
|
839
|
+
RCTPromiseResolveBlock)
|
|
840
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
787
841
|
NSMutableArray<JConversation *> *conversations = [NSMutableArray array];
|
|
788
842
|
for (NSDictionary *conversationMap in conversationMaps) {
|
|
789
|
-
[conversations
|
|
843
|
+
[conversations
|
|
844
|
+
addObject:[self convertDictionaryToConversation:conversationMap]];
|
|
790
845
|
}
|
|
791
|
-
|
|
846
|
+
|
|
792
847
|
[JIM.shared.conversationManager removeConversationList:conversations
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
848
|
+
fromTag:tagId
|
|
849
|
+
success:^{
|
|
850
|
+
resolve(@YES);
|
|
851
|
+
}
|
|
852
|
+
error:^(JErrorCode code) {
|
|
853
|
+
reject(@"error",
|
|
854
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)code], nil);
|
|
855
|
+
}];
|
|
799
856
|
}
|
|
800
857
|
|
|
801
858
|
#pragma mark - Helper Methods
|
|
@@ -804,404 +861,443 @@ RCT_EXPORT_METHOD(removeConversationsFromTag:(NSArray *)conversationMaps
|
|
|
804
861
|
* 将字典转换为会话对象
|
|
805
862
|
*/
|
|
806
863
|
- (JConversation *)convertDictionaryToConversation:(NSDictionary *)dict {
|
|
807
|
-
JConversationType type =
|
|
864
|
+
JConversationType type =
|
|
865
|
+
(JConversationType)[dict[@"conversationType"] intValue];
|
|
808
866
|
NSString *conversationId = dict[@"conversationId"];
|
|
809
|
-
return [[JConversation alloc] initWithConversationType:type
|
|
867
|
+
return [[JConversation alloc] initWithConversationType:type
|
|
868
|
+
conversationId:conversationId];
|
|
810
869
|
}
|
|
811
870
|
|
|
812
871
|
/**
|
|
813
872
|
* 发送消息
|
|
814
873
|
*/
|
|
815
|
-
RCT_EXPORT_METHOD(sendMessage:(NSDictionary *)messageDict
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
874
|
+
RCT_EXPORT_METHOD(sendMessage : (NSDictionary *)messageDict messageId : (
|
|
875
|
+
NSString *)messageId resolver : (RCTPromiseResolveBlock)
|
|
876
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
877
|
+
@try {
|
|
878
|
+
// 构建消息内容和会话对象
|
|
879
|
+
JMessageContent *content = [self
|
|
880
|
+
convertDictToMessageContent:[messageDict objectForKey:@"content"]];
|
|
881
|
+
JConversation *conversation =
|
|
882
|
+
[self convertDictionaryToConversation:messageDict];
|
|
883
|
+
|
|
884
|
+
if (!content) {
|
|
885
|
+
reject(@"SEND_MESSAGE_ERROR", @"无效的消息内容", nil);
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
// 发送消息
|
|
890
|
+
JMessage *message = [JIM.shared.messageManager sendMessage:content
|
|
891
|
+
inConversation:conversation
|
|
892
|
+
success:^(JMessage *message) {
|
|
893
|
+
[self sendEventWithName:@"onMessageSent"
|
|
894
|
+
body:@{
|
|
895
|
+
@"messageId" : messageId,
|
|
896
|
+
@"message" :
|
|
897
|
+
[self convertMessageToDictionary:message]
|
|
898
|
+
}];
|
|
827
899
|
}
|
|
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) {
|
|
900
|
+
error:^(JErrorCode errorCode, JMessage *message) {
|
|
839
901
|
[self sendEventWithName:@"onMessageSentError"
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
902
|
+
body:@{
|
|
903
|
+
@"messageId" : messageId,
|
|
904
|
+
@"message" :
|
|
905
|
+
[self convertMessageToDictionary:message],
|
|
906
|
+
@"errorCode" : @(errorCode)
|
|
907
|
+
}];
|
|
845
908
|
}];
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
909
|
+
NSMutableDictionary *result = [self convertMessageToDictionary:message];
|
|
910
|
+
result[@"messageId"] = messageId;
|
|
911
|
+
resolve(result);
|
|
912
|
+
} @catch (NSException *exception) {
|
|
913
|
+
reject(@"SEND_MESSAGE_ERROR", exception.reason, nil);
|
|
914
|
+
}
|
|
852
915
|
}
|
|
853
916
|
|
|
854
917
|
/**
|
|
855
918
|
* 发送图片消息
|
|
856
919
|
*/
|
|
857
|
-
RCT_EXPORT_METHOD(sendImageMessage:(NSDictionary *)messageDict
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
920
|
+
RCT_EXPORT_METHOD(sendImageMessage : (NSDictionary *)messageDict messageId : (
|
|
921
|
+
NSString *)messageId resolver : (RCTPromiseResolveBlock)
|
|
922
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
923
|
+
@try {
|
|
924
|
+
JConversation *conversation =
|
|
925
|
+
[self convertDictionaryToConversation:messageDict];
|
|
926
|
+
JImageMessage *imageMessage = [[JImageMessage alloc] init];
|
|
927
|
+
|
|
928
|
+
NSDictionary *contentDict = messageDict[@"content"];
|
|
929
|
+
if (contentDict[@"localPath"]) {
|
|
930
|
+
imageMessage.localPath = contentDict[@"localPath"];
|
|
931
|
+
}
|
|
932
|
+
if (contentDict[@"thumbnailLocalPath"]) {
|
|
933
|
+
imageMessage.thumbnailLocalPath = contentDict[@"thumbnailLocalPath"];
|
|
934
|
+
}
|
|
935
|
+
if (contentDict[@"url"]) {
|
|
936
|
+
imageMessage.url = contentDict[@"url"];
|
|
937
|
+
}
|
|
938
|
+
if (contentDict[@"thumbnailUrl"]) {
|
|
939
|
+
imageMessage.thumbnailUrl = contentDict[@"thumbnailUrl"];
|
|
940
|
+
}
|
|
941
|
+
if (contentDict[@"width"]) {
|
|
942
|
+
imageMessage.width = [contentDict[@"width"] integerValue];
|
|
943
|
+
}
|
|
944
|
+
if (contentDict[@"height"]) {
|
|
945
|
+
imageMessage.height = [contentDict[@"height"] integerValue];
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
JMessage *message = [JIM.shared.messageManager sendMediaMessage:imageMessage
|
|
949
|
+
inConversation:conversation
|
|
950
|
+
progress:^(int progress, JMessage *_Nonnull message) {
|
|
951
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
952
|
+
params[@"messageId"] = messageId;
|
|
953
|
+
params[@"progress"] = @(progress);
|
|
954
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
955
|
+
[self sendEventWithName:@"onMediaMessageProgress" body:params];
|
|
877
956
|
}
|
|
878
|
-
|
|
879
|
-
|
|
957
|
+
success:^(JMessage *_Nonnull message) {
|
|
958
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
959
|
+
params[@"messageId"] = messageId;
|
|
960
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
961
|
+
[self sendEventWithName:@"onMediaMessageSent" body:params];
|
|
880
962
|
}
|
|
881
|
-
|
|
882
|
-
|
|
963
|
+
error:^(JErrorCode errorCode, JMessage *_Nonnull message) {
|
|
964
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
965
|
+
params[@"messageId"] = messageId;
|
|
966
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
967
|
+
params[@"errorCode"] = @(errorCode);
|
|
968
|
+
[self sendEventWithName:@"onMediaMessageSentError" body:params];
|
|
883
969
|
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
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];
|
|
970
|
+
cancel:^(JMessage *_Nonnull message) {
|
|
971
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
972
|
+
params[@"messageId"] = messageId;
|
|
973
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
974
|
+
[self sendEventWithName:@"onMediaMessageCancelled" body:params];
|
|
909
975
|
}];
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
976
|
+
|
|
977
|
+
NSMutableDictionary *result = [self convertMessageToDictionary:message];
|
|
978
|
+
result[@"messageId"] = messageId;
|
|
979
|
+
resolve(result);
|
|
980
|
+
} @catch (NSException *exception) {
|
|
981
|
+
reject(@"SEND_IMAGE_MESSAGE_ERROR", exception.reason, nil);
|
|
982
|
+
}
|
|
917
983
|
}
|
|
918
984
|
|
|
919
985
|
/**
|
|
920
986
|
* 发送文件消息
|
|
921
987
|
*/
|
|
922
|
-
RCT_EXPORT_METHOD(sendFileMessage:(NSDictionary *)messageDict
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
988
|
+
RCT_EXPORT_METHOD(sendFileMessage : (NSDictionary *)messageDict messageId : (
|
|
989
|
+
NSString *)messageId resolver : (RCTPromiseResolveBlock)
|
|
990
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
991
|
+
@try {
|
|
992
|
+
JConversation *conversation =
|
|
993
|
+
[self convertDictionaryToConversation:messageDict];
|
|
994
|
+
JFileMessage *fileMessage = [[JFileMessage alloc] init];
|
|
995
|
+
|
|
996
|
+
NSDictionary *contentDict = messageDict[@"content"];
|
|
997
|
+
if (contentDict[@"localPath"]) {
|
|
998
|
+
fileMessage.localPath = contentDict[@"localPath"];
|
|
999
|
+
}
|
|
1000
|
+
if (contentDict[@"url"]) {
|
|
1001
|
+
fileMessage.url = contentDict[@"url"];
|
|
1002
|
+
}
|
|
1003
|
+
if (contentDict[@"name"]) {
|
|
1004
|
+
fileMessage.name = contentDict[@"name"];
|
|
1005
|
+
}
|
|
1006
|
+
if (contentDict[@"size"]) {
|
|
1007
|
+
fileMessage.size = [contentDict[@"size"] longLongValue];
|
|
1008
|
+
}
|
|
1009
|
+
if (contentDict[@"type"]) {
|
|
1010
|
+
fileMessage.type = contentDict[@"type"];
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
JMessage *message = [JIM.shared.messageManager sendMediaMessage:fileMessage
|
|
1014
|
+
inConversation:conversation
|
|
1015
|
+
progress:^(int progress, JMessage *_Nonnull message) {
|
|
1016
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1017
|
+
params[@"messageId"] = messageId;
|
|
1018
|
+
params[@"progress"] = @(progress);
|
|
1019
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1020
|
+
[self sendEventWithName:@"onMediaMessageProgress" body:params];
|
|
939
1021
|
}
|
|
940
|
-
|
|
941
|
-
|
|
1022
|
+
success:^(JMessage *_Nonnull message) {
|
|
1023
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1024
|
+
params[@"messageId"] = messageId;
|
|
1025
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1026
|
+
[self sendEventWithName:@"onMediaMessageSent" body:params];
|
|
942
1027
|
}
|
|
943
|
-
|
|
944
|
-
|
|
1028
|
+
error:^(JErrorCode errorCode, JMessage *_Nonnull message) {
|
|
1029
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1030
|
+
params[@"messageId"] = messageId;
|
|
1031
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1032
|
+
params[@"errorCode"] = @(errorCode);
|
|
1033
|
+
[self sendEventWithName:@"onMediaMessageSentError" body:params];
|
|
945
1034
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
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];
|
|
1035
|
+
cancel:^(JMessage *_Nonnull message) {
|
|
1036
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1037
|
+
params[@"messageId"] = messageId;
|
|
1038
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1039
|
+
[self sendEventWithName:@"onMediaMessageCancelled" body:params];
|
|
971
1040
|
}];
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1041
|
+
|
|
1042
|
+
NSMutableDictionary *result = [self convertMessageToDictionary:message];
|
|
1043
|
+
result[@"messageId"] = messageId;
|
|
1044
|
+
resolve(result);
|
|
1045
|
+
} @catch (NSException *exception) {
|
|
1046
|
+
reject(@"SEND_FILE_MESSAGE_ERROR", exception.reason, nil);
|
|
1047
|
+
}
|
|
979
1048
|
}
|
|
980
1049
|
|
|
981
1050
|
/**
|
|
982
1051
|
* 发送语音消息
|
|
983
1052
|
*/
|
|
984
|
-
RCT_EXPORT_METHOD(sendVoiceMessage:(NSDictionary *)messageDict
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1053
|
+
RCT_EXPORT_METHOD(sendVoiceMessage : (NSDictionary *)messageDict messageId : (
|
|
1054
|
+
NSString *)messageId resolver : (RCTPromiseResolveBlock)
|
|
1055
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1056
|
+
@try {
|
|
1057
|
+
JConversation *conversation =
|
|
1058
|
+
[self convertDictionaryToConversation:messageDict];
|
|
1059
|
+
JVoiceMessage *voiceMessage = [[JVoiceMessage alloc] init];
|
|
1060
|
+
|
|
1061
|
+
NSDictionary *contentDict = messageDict[@"content"];
|
|
1062
|
+
if (contentDict[@"localPath"]) {
|
|
1063
|
+
voiceMessage.localPath = contentDict[@"localPath"];
|
|
1064
|
+
}
|
|
1065
|
+
if (contentDict[@"url"]) {
|
|
1066
|
+
voiceMessage.url = contentDict[@"url"];
|
|
1067
|
+
}
|
|
1068
|
+
if (contentDict[@"duration"]) {
|
|
1069
|
+
voiceMessage.duration = [contentDict[@"duration"] integerValue];
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
JMessage *message = [JIM.shared.messageManager sendMediaMessage:voiceMessage
|
|
1073
|
+
inConversation:conversation
|
|
1074
|
+
progress:^(int progress, JMessage *_Nonnull message) {
|
|
1075
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1076
|
+
params[@"messageId"] = messageId;
|
|
1077
|
+
params[@"progress"] = @(progress);
|
|
1078
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1079
|
+
[self sendEventWithName:@"onMediaMessageProgress" body:params];
|
|
995
1080
|
}
|
|
996
|
-
|
|
997
|
-
|
|
1081
|
+
success:^(JMessage *_Nonnull message) {
|
|
1082
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1083
|
+
params[@"messageId"] = messageId;
|
|
1084
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1085
|
+
[self sendEventWithName:@"onMediaMessageSent" body:params];
|
|
998
1086
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1087
|
+
error:^(JErrorCode errorCode, JMessage *_Nonnull message) {
|
|
1088
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1089
|
+
params[@"messageId"] = messageId;
|
|
1090
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1091
|
+
params[@"errorCode"] = @(errorCode);
|
|
1092
|
+
[self sendEventWithName:@"onMediaMessageSentError" body:params];
|
|
1001
1093
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
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];
|
|
1094
|
+
cancel:^(JMessage *_Nonnull message) {
|
|
1095
|
+
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
1096
|
+
params[@"messageId"] = messageId;
|
|
1097
|
+
params[@"message"] = [self convertMessageToDictionary:message];
|
|
1098
|
+
[self sendEventWithName:@"onMediaMessageCancelled" body:params];
|
|
1027
1099
|
}];
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1100
|
+
|
|
1101
|
+
NSMutableDictionary *result = [self convertMessageToDictionary:message];
|
|
1102
|
+
result[@"messageId"] = messageId;
|
|
1103
|
+
resolve(result);
|
|
1104
|
+
} @catch (NSException *exception) {
|
|
1105
|
+
reject(@"SEND_VOICE_MESSAGE_ERROR", exception.reason, nil);
|
|
1106
|
+
}
|
|
1035
1107
|
}
|
|
1036
1108
|
|
|
1037
1109
|
/**
|
|
1038
1110
|
* 获取历史消息
|
|
1039
1111
|
*/
|
|
1040
|
-
RCT_EXPORT_METHOD(getMessages:(NSDictionary *)conversationDict
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
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);
|
|
1112
|
+
RCT_EXPORT_METHOD(getMessages : (NSDictionary *)conversationDict direction : (
|
|
1113
|
+
int)direction options : (NSDictionary *)
|
|
1114
|
+
options resolver : (RCTPromiseResolveBlock)
|
|
1115
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1116
|
+
@try {
|
|
1117
|
+
JConversation *conversation =
|
|
1118
|
+
[self convertDictionaryToConversation:conversationDict];
|
|
1119
|
+
JGetMessageOptions *getOptions = [[JGetMessageOptions alloc] init];
|
|
1120
|
+
|
|
1121
|
+
if (options[@"count"]) {
|
|
1122
|
+
getOptions.count = [options[@"count"] integerValue];
|
|
1079
1123
|
}
|
|
1124
|
+
if (options[@"startTime"]) {
|
|
1125
|
+
getOptions.startTime = [options[@"startTime"] longLongValue];
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
JPullDirection pullDirection =
|
|
1129
|
+
direction == 0 ? JPullDirectionOlder : JPullDirectionNewer;
|
|
1130
|
+
|
|
1131
|
+
[JIM.shared.messageManager
|
|
1132
|
+
getMessages:conversation
|
|
1133
|
+
direction:pullDirection
|
|
1134
|
+
option:getOptions
|
|
1135
|
+
complete:^(NSArray<JMessage *> *messages, long long timestamp,
|
|
1136
|
+
BOOL hasMore, JErrorCode code) {
|
|
1137
|
+
NSMutableArray *messageArray = [NSMutableArray array];
|
|
1138
|
+
for (JMessage *msg in messages) {
|
|
1139
|
+
[messageArray addObject:[self convertMessageToDictionary:msg]];
|
|
1140
|
+
}
|
|
1141
|
+
NSLog(@"getMessages complete: %lu messages, timestamp: %lld, "
|
|
1142
|
+
@"hasMore: %d, code: %ld",
|
|
1143
|
+
(unsigned long)messages.count, timestamp, hasMore,
|
|
1144
|
+
(long)code);
|
|
1145
|
+
NSDictionary *result = @{
|
|
1146
|
+
@"messages" : messageArray,
|
|
1147
|
+
@"timestamp" : @(timestamp),
|
|
1148
|
+
@"hasMore" : @(hasMore),
|
|
1149
|
+
@"code" : @(code)
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
resolve(result);
|
|
1153
|
+
}];
|
|
1154
|
+
} @catch (NSException *exception) {
|
|
1155
|
+
reject(@"GET_MESSAGES_ERROR", exception.reason, nil);
|
|
1156
|
+
}
|
|
1080
1157
|
}
|
|
1081
1158
|
|
|
1082
1159
|
/**
|
|
1083
1160
|
* 撤回消息
|
|
1084
1161
|
*/
|
|
1085
|
-
RCT_EXPORT_METHOD(recallMessage:(NSString *)messageId
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
@
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1162
|
+
RCT_EXPORT_METHOD(recallMessage : (NSString *)messageId extras : (
|
|
1163
|
+
NSDictionary *)extras resolver : (RCTPromiseResolveBlock)
|
|
1164
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1165
|
+
@try {
|
|
1166
|
+
NSDictionary *extrasDict = extras ?: @{};
|
|
1167
|
+
|
|
1168
|
+
[JIM.shared.messageManager recallMessage:messageId
|
|
1169
|
+
extras:extrasDict
|
|
1170
|
+
success:^(JMessage *message) {
|
|
1171
|
+
resolve(@YES);
|
|
1172
|
+
}
|
|
1173
|
+
error:^(JErrorCode errorCode) {
|
|
1174
|
+
reject(
|
|
1175
|
+
@"RECALL_MESSAGE_ERROR",
|
|
1176
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)errorCode],
|
|
1177
|
+
nil);
|
|
1098
1178
|
}];
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1179
|
+
} @catch (NSException *exception) {
|
|
1180
|
+
reject(@"RECALL_MESSAGE_ERROR", exception.reason, nil);
|
|
1181
|
+
}
|
|
1102
1182
|
}
|
|
1103
1183
|
|
|
1104
1184
|
/**
|
|
1105
1185
|
* 根据clientMsgNo列表删除消息
|
|
1106
1186
|
*/
|
|
1107
|
-
RCT_EXPORT_METHOD(deleteMessagesByClientMsgNoList:(
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1187
|
+
RCT_EXPORT_METHOD(deleteMessagesByClientMsgNoList : (
|
|
1188
|
+
NSDictionary *)conversationMap clientMsgNos : (NSArray<NSNumber *> *)
|
|
1189
|
+
clientMsgNos resolver : (RCTPromiseResolveBlock)
|
|
1190
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1191
|
+
@try {
|
|
1192
|
+
JConversation *conversation =
|
|
1193
|
+
[self convertDictionaryToConversation:conversationMap];
|
|
1194
|
+
|
|
1195
|
+
[JIM.shared.messageManager deleteMessagesByClientMsgNoList:clientMsgNos
|
|
1196
|
+
conversation:conversation
|
|
1197
|
+
success:^{
|
|
1198
|
+
resolve(@YES);
|
|
1199
|
+
}
|
|
1200
|
+
error:^(JErrorCode errorCode) {
|
|
1201
|
+
reject(
|
|
1202
|
+
@"DELETE_MESSAGES_ERROR",
|
|
1203
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)errorCode],
|
|
1204
|
+
nil);
|
|
1120
1205
|
}];
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1206
|
+
} @catch (NSException *exception) {
|
|
1207
|
+
reject(@"DELETE_MESSAGES_ERROR", exception.reason, nil);
|
|
1208
|
+
}
|
|
1124
1209
|
}
|
|
1125
1210
|
|
|
1126
1211
|
/**
|
|
1127
1212
|
* 添加消息反应
|
|
1128
1213
|
*/
|
|
1129
|
-
RCT_EXPORT_METHOD(
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1214
|
+
RCT_EXPORT_METHOD(
|
|
1215
|
+
addMessageReaction : (NSDictionary *)messageDict reactionId : (NSString *)
|
|
1216
|
+
reactionId resolver : (RCTPromiseResolveBlock)
|
|
1217
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1218
|
+
@try {
|
|
1219
|
+
NSString *messageId = messageDict[@"messageId"];
|
|
1220
|
+
JConversation *conversation =
|
|
1221
|
+
[self convertDictionaryToConversation:messageDict];
|
|
1222
|
+
|
|
1223
|
+
[JIM.shared.messageManager addMessageReaction:messageId
|
|
1224
|
+
conversation:conversation
|
|
1225
|
+
reactionId:reactionId
|
|
1226
|
+
success:^{
|
|
1227
|
+
resolve(@YES);
|
|
1228
|
+
}
|
|
1229
|
+
error:^(JErrorCode errorCode) {
|
|
1230
|
+
reject(
|
|
1231
|
+
@"ADD_REACTION_ERROR",
|
|
1232
|
+
[NSString stringWithFormat:@"Error code: %ld", (long)errorCode],
|
|
1233
|
+
nil);
|
|
1144
1234
|
}];
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1235
|
+
} @catch (NSException *exception) {
|
|
1236
|
+
reject(@"ADD_REACTION_ERROR", exception.reason, nil);
|
|
1237
|
+
}
|
|
1148
1238
|
}
|
|
1149
1239
|
|
|
1150
1240
|
/**
|
|
1151
1241
|
* 移除消息反应
|
|
1152
1242
|
*/
|
|
1153
|
-
RCT_EXPORT_METHOD(removeMessageReaction:(
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1243
|
+
RCT_EXPORT_METHOD(removeMessageReaction : (
|
|
1244
|
+
NSDictionary *)messageDict reactionId : (NSString *)
|
|
1245
|
+
reactionId resolver : (RCTPromiseResolveBlock)
|
|
1246
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
1247
|
+
@try {
|
|
1248
|
+
NSString *messageId = messageDict[@"messageId"];
|
|
1249
|
+
JConversation *conversation =
|
|
1250
|
+
[self convertDictionaryToConversation:messageDict];
|
|
1251
|
+
|
|
1252
|
+
[JIM.shared.messageManager removeMessageReaction:messageId
|
|
1253
|
+
conversation:conversation
|
|
1254
|
+
reactionId:reactionId
|
|
1255
|
+
success:^{
|
|
1256
|
+
resolve(@YES);
|
|
1257
|
+
}
|
|
1258
|
+
error:^(JErrorCode errorCode) {
|
|
1259
|
+
reject(@"REMOVE_REACTION_ERROR", @"移除反应失败",
|
|
1260
|
+
[NSError errorWithDomain:@"JuggleIM"
|
|
1261
|
+
code:errorCode
|
|
1262
|
+
userInfo:nil]);
|
|
1168
1263
|
}];
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1264
|
+
} @catch (NSException *exception) {
|
|
1265
|
+
reject(@"REMOVE_REACTION_ERROR", exception.reason, nil);
|
|
1266
|
+
}
|
|
1172
1267
|
}
|
|
1173
1268
|
|
|
1174
1269
|
// 辅助方法:将字典转换为消息内容
|
|
1175
1270
|
- (JMessageContent *)convertDictToMessageContent:(NSDictionary *)messageDict {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1271
|
+
NSString *contentType = messageDict[@"contentType"];
|
|
1272
|
+
|
|
1273
|
+
if ([contentType isEqualToString:@"jg:text"]) {
|
|
1274
|
+
JTextMessage *text =
|
|
1275
|
+
[[JTextMessage alloc] initWithContent:messageDict[@"content"] ?: @""];
|
|
1276
|
+
return text;
|
|
1277
|
+
} else if ([contentType isEqualToString:@"jg:img"]) {
|
|
1278
|
+
JImageMessage *img = [[JImageMessage alloc] init];
|
|
1279
|
+
img.url = messageDict[@"url"];
|
|
1280
|
+
img.localPath = messageDict[@"localPath"];
|
|
1281
|
+
img.thumbnailLocalPath = messageDict[@"thumbnailLocalPath"];
|
|
1282
|
+
img.thumbnailUrl = messageDict[@"thumbnailUrl"];
|
|
1283
|
+
img.width = [messageDict[@"width"] integerValue];
|
|
1284
|
+
img.height = [messageDict[@"height"] integerValue];
|
|
1285
|
+
return img;
|
|
1286
|
+
} else if ([contentType isEqualToString:@"jg:file"]) {
|
|
1287
|
+
JFileMessage *file = [[JFileMessage alloc] init];
|
|
1288
|
+
file.url = messageDict[@"url"];
|
|
1289
|
+
file.type = messageDict[@"type"];
|
|
1290
|
+
file.name = messageDict[@"name"];
|
|
1291
|
+
file.size = [messageDict[@"size"] longLongValue];
|
|
1292
|
+
return file;
|
|
1293
|
+
} else if ([contentType isEqualToString:@"jg:voice"]) {
|
|
1294
|
+
JVoiceMessage *voice = [[JVoiceMessage alloc] init];
|
|
1295
|
+
voice.url = messageDict[@"url"];
|
|
1296
|
+
voice.localPath = messageDict[@"localPath"];
|
|
1297
|
+
voice.duration = [messageDict[@"duration"] integerValue];
|
|
1298
|
+
return voice;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
return nil;
|
|
1206
1302
|
}
|
|
1207
1303
|
@end
|