@react-native-hero/network 0.0.4 → 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.
- package/{react-native-hero-network.podspec → HeroNetwork.podspec} +1 -1
- package/README.md +36 -8
- package/android/build/.transforms/6401b6ecf91d46493d47a7cae1425ae5/results.bin +1 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/results.bin +1 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/BuildConfig.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule$Companion.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule$createCustomRequestBody$1.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule$download$1.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule$fetch$5.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule$upload$3.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule$upload$formBuilder$1.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkModule.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/debug/com/github/reactnativehero/network/RNTNetworkPackage.dex +0 -0
- package/android/build/.transforms/eeb57ddf43a2a6e78f005db6d0c545c3/transformed/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/com/github/reactnativehero/network/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +12 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +16 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -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_symbol_list/debug/R.txt +1856 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/classes/com/github/reactnativehero/network/BuildConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +18 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +12 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +16 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-hero_network_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule$createCustomRequestBody$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule$download$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule$fetch$5.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule$upload$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule$upload$formBuilder$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/com/github/reactnativehero/network/RNTNetworkPackage.class +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +1376 -0
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +33 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-hero_network_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule$createCustomRequestBody$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule$download$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule$fetch$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule$upload$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule$upload$formBuilder$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/github/reactnativehero/network/RNTNetworkPackage.class +0 -0
- package/android/src/main/java/com/github/reactnativehero/network/RNTNetworkModule.kt +90 -15
- package/index.js +8 -0
- package/ios/RNTNetwork/RNTNetwork.m +94 -17
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream
ADDED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream
ADDED
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len
ADDED
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-- Merging decision tree log ---
|
|
2
|
+
manifest
|
|
3
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:1:1-7:12
|
|
4
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:1:1-7:12
|
|
5
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:1:1-7:12
|
|
6
|
+
package
|
|
7
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:2:11-55
|
|
8
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
9
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
10
|
+
xmlns:android
|
|
11
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:1:11-69
|
|
12
|
+
uses-permission#android.permission.INTERNET
|
|
13
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:4:5-67
|
|
14
|
+
android:name
|
|
15
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:4:22-64
|
|
16
|
+
uses-permission#android.permission.READ_EXTERNAL_STORAGE
|
|
17
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:5:5-80
|
|
18
|
+
android:name
|
|
19
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml:5:22-77
|
|
20
|
+
uses-sdk
|
|
21
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
|
22
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
23
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
24
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
25
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
26
|
+
android:targetSdkVersion
|
|
27
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
28
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
29
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
30
|
+
android:minSdkVersion
|
|
31
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
32
|
+
ADDED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
33
|
+
INJECTED from /Users/musicode/workspace/fe-team/finstao-app/node_modules/@react-native-hero/network/android/src/main/AndroidManifest.xml
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -4,18 +4,24 @@ import com.facebook.react.bridge.*
|
|
|
4
4
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
5
5
|
import okhttp3.*
|
|
6
6
|
import okhttp3.Callback
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
|
8
|
+
import okhttp3.MediaType.Companion.toMediaType
|
|
9
|
+
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
|
10
|
+
import okhttp3.RequestBody.Companion.toRequestBody
|
|
11
|
+
import okio.*
|
|
12
|
+
import org.json.JSONObject
|
|
10
13
|
import java.io.File
|
|
11
14
|
import java.io.IOException
|
|
12
15
|
import java.util.*
|
|
13
16
|
|
|
17
|
+
|
|
14
18
|
class RNTNetworkModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
15
19
|
|
|
16
20
|
companion object {
|
|
17
21
|
private const val ERROR_CODE_DOWNLOAD_FAILURE = "1"
|
|
18
22
|
private const val ERROR_CODE_UPLOAD_FAILURE = "2"
|
|
23
|
+
private const val ERROR_CODE_FETCH_FAILURE = "3"
|
|
24
|
+
private val JSON = "application/json; charset=utf-8".toMediaType()
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
override fun getName(): String {
|
|
@@ -28,6 +34,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
28
34
|
|
|
29
35
|
constants["ERROR_CODE_DOWNLOAD_FAILURE"] = ERROR_CODE_DOWNLOAD_FAILURE
|
|
30
36
|
constants["ERROR_CODE_UPLOAD_FAILURE"] = ERROR_CODE_UPLOAD_FAILURE
|
|
37
|
+
constants["ERROR_CODE_FETCH_FAILURE"] = ERROR_CODE_FETCH_FAILURE
|
|
31
38
|
|
|
32
39
|
return constants
|
|
33
40
|
|
|
@@ -55,12 +62,12 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
55
62
|
}
|
|
56
63
|
|
|
57
64
|
override fun onResponse(call: Call, response: Response) {
|
|
58
|
-
response.body
|
|
65
|
+
response.body?.let { body ->
|
|
59
66
|
|
|
60
67
|
val file = File(path)
|
|
61
68
|
|
|
62
|
-
val sink =
|
|
63
|
-
val sinkBuffer = sink.buffer
|
|
69
|
+
val sink = file.sink().buffer()
|
|
70
|
+
val sinkBuffer = sink.buffer
|
|
64
71
|
|
|
65
72
|
val source = body.source()
|
|
66
73
|
|
|
@@ -111,14 +118,14 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
111
118
|
val file = options.getMap("file") as ReadableMap
|
|
112
119
|
|
|
113
120
|
val data = if (options.hasKey("data")) {
|
|
114
|
-
options.getMap("data")
|
|
121
|
+
options.getMap("data")?.toHashMap()
|
|
115
122
|
}
|
|
116
123
|
else {
|
|
117
124
|
null
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
val headers = if (options.hasKey("headers")) {
|
|
121
|
-
options.getMap("headers")
|
|
128
|
+
options.getMap("headers")?.toHashMap()
|
|
122
129
|
}
|
|
123
130
|
else {
|
|
124
131
|
null
|
|
@@ -141,7 +148,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
141
148
|
name,
|
|
142
149
|
fileName,
|
|
143
150
|
createCustomRequestBody(
|
|
144
|
-
|
|
151
|
+
mimeType.toMediaTypeOrNull(),
|
|
145
152
|
localFile
|
|
146
153
|
) {
|
|
147
154
|
if (index > 0) {
|
|
@@ -154,7 +161,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
154
161
|
)
|
|
155
162
|
|
|
156
163
|
data?.let {
|
|
157
|
-
for ((key,value) in it
|
|
164
|
+
for ((key,value) in it) {
|
|
158
165
|
formBuilder.addFormDataPart(key, value.toString())
|
|
159
166
|
}
|
|
160
167
|
}
|
|
@@ -163,7 +170,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
163
170
|
val requestBuilder = Request.Builder().url(url).post(formBuilder.build())
|
|
164
171
|
|
|
165
172
|
headers?.let {
|
|
166
|
-
for ((key, value) in it
|
|
173
|
+
for ((key, value) in it) {
|
|
167
174
|
requestBuilder.addHeader(key, value.toString())
|
|
168
175
|
}
|
|
169
176
|
}
|
|
@@ -175,8 +182,76 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
175
182
|
|
|
176
183
|
override fun onResponse(call: Call, response: Response) {
|
|
177
184
|
val map = Arguments.createMap()
|
|
178
|
-
map.putInt("status_code", response.code
|
|
179
|
-
map.putString("body", response.body
|
|
185
|
+
map.putInt("status_code", response.code)
|
|
186
|
+
map.putString("body", response.body?.string())
|
|
187
|
+
promise.resolve(map)
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@ReactMethod
|
|
194
|
+
fun fetch(options: ReadableMap, promise: Promise) {
|
|
195
|
+
|
|
196
|
+
var url = options.getString("url") as String
|
|
197
|
+
val method = options.getString("method") as String
|
|
198
|
+
|
|
199
|
+
val data = if (options.hasKey("data")) {
|
|
200
|
+
options.getMap("data")?.toHashMap()
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
null
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
val headers = if (options.hasKey("headers")) {
|
|
207
|
+
options.getMap("headers")?.toHashMap()
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
null
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
val client = OkHttpClient()
|
|
214
|
+
val isPost = method.toUpperCase(Locale.ROOT) == "POST"
|
|
215
|
+
|
|
216
|
+
var requestBody: RequestBody? = null
|
|
217
|
+
|
|
218
|
+
if (isPost) {
|
|
219
|
+
data?.let {
|
|
220
|
+
requestBody = JSONObject(it).toString().toRequestBody(JSON)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
val httpUrl = url.toHttpUrlOrNull() ?: return
|
|
225
|
+
val urlBuilder = httpUrl.newBuilder()
|
|
226
|
+
data?.let {
|
|
227
|
+
for ((key, value) in it) {
|
|
228
|
+
urlBuilder.addQueryParameter(key, value.toString())
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
url = urlBuilder.build().toString()
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
var requestBuilder = Request.Builder().url(url)
|
|
235
|
+
|
|
236
|
+
requestBody?.let {
|
|
237
|
+
requestBuilder = requestBuilder.post(it)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
headers?.let {
|
|
241
|
+
for ((key, value) in it) {
|
|
242
|
+
requestBuilder.addHeader(key, value.toString())
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
client.newCall(requestBuilder.build()).enqueue(object : Callback {
|
|
247
|
+
override fun onFailure(call: Call, e: IOException) {
|
|
248
|
+
promise.reject(ERROR_CODE_FETCH_FAILURE, e.localizedMessage)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
override fun onResponse(call: Call, response: Response) {
|
|
252
|
+
val map = Arguments.createMap()
|
|
253
|
+
map.putInt("status_code", response.code)
|
|
254
|
+
map.putString("body", response.body?.string())
|
|
180
255
|
promise.resolve(map)
|
|
181
256
|
}
|
|
182
257
|
})
|
|
@@ -195,7 +270,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
195
270
|
|
|
196
271
|
override fun writeTo(sink: BufferedSink) {
|
|
197
272
|
|
|
198
|
-
val source =
|
|
273
|
+
val source = file.source()
|
|
199
274
|
val buf = Buffer()
|
|
200
275
|
|
|
201
276
|
val totalSize = contentLength()
|
|
@@ -219,4 +294,4 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
219
294
|
.emit(eventName, params)
|
|
220
295
|
}
|
|
221
296
|
|
|
222
|
-
}
|
|
297
|
+
}
|
package/index.js
CHANGED
|
@@ -22,6 +22,7 @@ eventEmitter.addListener('upload_progress', handleProgress)
|
|
|
22
22
|
export const CODE = {
|
|
23
23
|
DOWNLOAD_FAILURE: RNTNetwork.ERROR_CODE_DOWNLOAD_FAILURE,
|
|
24
24
|
UPLOAD_FAILURE: RNTNetwork.ERROR_CODE_UPLOAD_FAILURE,
|
|
25
|
+
FETCH_FAILURE: RNTNetwork.ERROR_CODE_FETCH_FAILURE,
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -55,3 +56,10 @@ export function upload(options, onProgress) {
|
|
|
55
56
|
}
|
|
56
57
|
})
|
|
57
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 发送请求
|
|
62
|
+
*/
|
|
63
|
+
export function fetch(options) {
|
|
64
|
+
return RNTNetwork.fetch(options)
|
|
65
|
+
}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
#import <React/RCTConvert.h>
|
|
3
3
|
#import <AFNetworking/AFNetworking.h>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
@implementation RNTNetwork
|
|
6
6
|
|
|
7
|
-
NSString *ERROR_CODE_DOWNLOAD_FAILURE = @"1";
|
|
8
|
-
NSString *ERROR_CODE_UPLOAD_FAILURE = @"2";
|
|
7
|
+
static NSString *ERROR_CODE_DOWNLOAD_FAILURE = @"1";
|
|
8
|
+
static NSString *ERROR_CODE_UPLOAD_FAILURE = @"2";
|
|
9
|
+
static NSString *ERROR_CODE_FETCH_FAILURE = @"3";
|
|
9
10
|
|
|
10
|
-
NSDictionary* getFileInfo(NSURL *url) {
|
|
11
|
+
static NSDictionary* getFileInfo(NSURL *url) {
|
|
11
12
|
|
|
12
13
|
NSData *data = [NSData dataWithContentsOfURL:url];
|
|
13
14
|
NSInteger size = [data length];
|
|
14
15
|
|
|
15
16
|
NSString *path = url.absoluteString;
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
NSString *prefix = @"file://";
|
|
18
|
+
if ([path hasPrefix:prefix]) {
|
|
19
|
+
path = [path substringFromIndex:[prefix length]];
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
return @{
|
|
@@ -25,22 +27,19 @@ NSDictionary* getFileInfo(NSURL *url) {
|
|
|
25
27
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
NSData* getFileData(NSString *path) {
|
|
29
|
-
|
|
30
|
-
NSData *data = [NSData dataWithContentsOfFile:path];
|
|
31
|
-
return data;
|
|
30
|
+
static NSData* getFileData(NSString *path) {
|
|
32
31
|
|
|
32
|
+
return [NSData dataWithContentsOfFile:path];
|
|
33
|
+
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
NSString* dictionary2JsonString(NSDictionary *dict) {
|
|
36
|
+
static NSString* dictionary2JsonString(NSDictionary *dict) {
|
|
36
37
|
|
|
37
38
|
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:nil];
|
|
38
39
|
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
|
39
40
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
@implementation RNTNetwork
|
|
43
|
-
|
|
44
43
|
+ (BOOL)requiresMainQueueSetup {
|
|
45
44
|
return YES;
|
|
46
45
|
}
|
|
@@ -50,16 +49,17 @@ NSString* dictionary2JsonString(NSDictionary *dict) {
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
- (NSArray<NSString *> *)supportedEvents {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
return @[
|
|
53
|
+
@"download_progress",
|
|
54
|
+
@"upload_progress",
|
|
55
|
+
];
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
- (NSDictionary *)constantsToExport {
|
|
60
59
|
return @{
|
|
61
60
|
@"ERROR_CODE_DOWNLOAD_FAILURE": ERROR_CODE_DOWNLOAD_FAILURE,
|
|
62
61
|
@"ERROR_CODE_UPLOAD_FAILURE": ERROR_CODE_UPLOAD_FAILURE,
|
|
62
|
+
@"ERROR_CODE_FETCH_FAILURE": ERROR_CODE_FETCH_FAILURE,
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -189,4 +189,81 @@ RCT_EXPORT_METHOD(upload:(NSDictionary*)options resolve:(RCTPromiseResolveBlock)
|
|
|
189
189
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
RCT_EXPORT_METHOD(fetch:(NSDictionary*)options resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
193
|
+
|
|
194
|
+
NSString *url = [RCTConvert NSString:options[@"url"]];
|
|
195
|
+
NSString *method = [RCTConvert NSString:options[@"method"]];
|
|
196
|
+
NSDictionary *data = [RCTConvert NSDictionary:options[@"data"]];
|
|
197
|
+
NSDictionary *headers = [RCTConvert NSDictionary:options[@"headers"]];
|
|
198
|
+
|
|
199
|
+
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
|
|
200
|
+
manager.responseSerializer = [AFJSONResponseSerializer serializer];
|
|
201
|
+
|
|
202
|
+
if ([method.uppercaseString isEqual: @"POST"]) {
|
|
203
|
+
manager.requestSerializer = [AFJSONRequestSerializer serializer];
|
|
204
|
+
[manager
|
|
205
|
+
POST:url
|
|
206
|
+
parameters:data
|
|
207
|
+
headers:headers
|
|
208
|
+
progress:nil
|
|
209
|
+
success:^(NSURLSessionDataTask *task, id responseObject) {
|
|
210
|
+
|
|
211
|
+
NSURLResponse *response = task.response;
|
|
212
|
+
|
|
213
|
+
NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
|
|
214
|
+
|
|
215
|
+
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
|
|
216
|
+
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
|
|
217
|
+
result[@"status_code"] = @(httpResponse.statusCode);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if ([responseObject isKindOfClass:[NSDictionary class]]) {
|
|
221
|
+
NSDictionary *json = (NSDictionary*)responseObject;
|
|
222
|
+
// 安卓返回 map 比较麻烦,因此这里统一改成返回字符串
|
|
223
|
+
result[@"body"] = dictionary2JsonString(json);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
resolve(result);
|
|
227
|
+
|
|
228
|
+
}
|
|
229
|
+
failure:^(NSURLSessionDataTask *task, NSError *error) {
|
|
230
|
+
reject(ERROR_CODE_FETCH_FAILURE, error.localizedDescription, error);
|
|
231
|
+
}
|
|
232
|
+
];
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
[manager
|
|
236
|
+
GET:url
|
|
237
|
+
parameters:data
|
|
238
|
+
headers:headers
|
|
239
|
+
progress:nil
|
|
240
|
+
success:^(NSURLSessionDataTask *task, id responseObject) {
|
|
241
|
+
|
|
242
|
+
NSURLResponse *response = task.response;
|
|
243
|
+
|
|
244
|
+
NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
|
|
245
|
+
|
|
246
|
+
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
|
|
247
|
+
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
|
|
248
|
+
result[@"status_code"] = @(httpResponse.statusCode);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if ([responseObject isKindOfClass:[NSDictionary class]]) {
|
|
252
|
+
NSDictionary *json = (NSDictionary*)responseObject;
|
|
253
|
+
// 安卓返回 map 比较麻烦,因此这里统一改成返回字符串
|
|
254
|
+
result[@"body"] = dictionary2JsonString(json);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
resolve(result);
|
|
258
|
+
|
|
259
|
+
}
|
|
260
|
+
failure:^(NSURLSessionDataTask *task, NSError *error) {
|
|
261
|
+
reject(ERROR_CODE_FETCH_FAILURE, error.localizedDescription, error);
|
|
262
|
+
}
|
|
263
|
+
];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
|
|
192
269
|
@end
|