@react-native-hero/network 0.0.7 → 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/README.md +30 -7
- 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 +80 -4
- package/index.js +8 -0
- package/ios/RNTNetwork/RNTNetwork.m +79 -0
- 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,17 +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 okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
|
8
|
+
import okhttp3.MediaType.Companion.toMediaType
|
|
7
9
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
|
10
|
+
import okhttp3.RequestBody.Companion.toRequestBody
|
|
8
11
|
import okio.*
|
|
12
|
+
import org.json.JSONObject
|
|
9
13
|
import java.io.File
|
|
10
14
|
import java.io.IOException
|
|
11
15
|
import java.util.*
|
|
12
16
|
|
|
17
|
+
|
|
13
18
|
class RNTNetworkModule(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
|
14
19
|
|
|
15
20
|
companion object {
|
|
16
21
|
private const val ERROR_CODE_DOWNLOAD_FAILURE = "1"
|
|
17
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()
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
override fun getName(): String {
|
|
@@ -27,6 +34,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
27
34
|
|
|
28
35
|
constants["ERROR_CODE_DOWNLOAD_FAILURE"] = ERROR_CODE_DOWNLOAD_FAILURE
|
|
29
36
|
constants["ERROR_CODE_UPLOAD_FAILURE"] = ERROR_CODE_UPLOAD_FAILURE
|
|
37
|
+
constants["ERROR_CODE_FETCH_FAILURE"] = ERROR_CODE_FETCH_FAILURE
|
|
30
38
|
|
|
31
39
|
return constants
|
|
32
40
|
|
|
@@ -110,14 +118,14 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
110
118
|
val file = options.getMap("file") as ReadableMap
|
|
111
119
|
|
|
112
120
|
val data = if (options.hasKey("data")) {
|
|
113
|
-
options.getMap("data")
|
|
121
|
+
options.getMap("data")?.toHashMap()
|
|
114
122
|
}
|
|
115
123
|
else {
|
|
116
124
|
null
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
val headers = if (options.hasKey("headers")) {
|
|
120
|
-
options.getMap("headers")
|
|
128
|
+
options.getMap("headers")?.toHashMap()
|
|
121
129
|
}
|
|
122
130
|
else {
|
|
123
131
|
null
|
|
@@ -153,7 +161,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
153
161
|
)
|
|
154
162
|
|
|
155
163
|
data?.let {
|
|
156
|
-
for ((key,value) in it
|
|
164
|
+
for ((key,value) in it) {
|
|
157
165
|
formBuilder.addFormDataPart(key, value.toString())
|
|
158
166
|
}
|
|
159
167
|
}
|
|
@@ -162,7 +170,7 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
162
170
|
val requestBuilder = Request.Builder().url(url).post(formBuilder.build())
|
|
163
171
|
|
|
164
172
|
headers?.let {
|
|
165
|
-
for ((key, value) in it
|
|
173
|
+
for ((key, value) in it) {
|
|
166
174
|
requestBuilder.addHeader(key, value.toString())
|
|
167
175
|
}
|
|
168
176
|
}
|
|
@@ -182,6 +190,74 @@ class RNTNetworkModule(private val reactContext: ReactApplicationContext) : Reac
|
|
|
182
190
|
|
|
183
191
|
}
|
|
184
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())
|
|
255
|
+
promise.resolve(map)
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
}
|
|
260
|
+
|
|
185
261
|
private fun createCustomRequestBody(contentType: MediaType?, file: File, onProgress: (Double) -> Unit): RequestBody {
|
|
186
262
|
return object : RequestBody() {
|
|
187
263
|
override fun contentType(): MediaType? {
|
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
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
static NSString *ERROR_CODE_DOWNLOAD_FAILURE = @"1";
|
|
8
8
|
static NSString *ERROR_CODE_UPLOAD_FAILURE = @"2";
|
|
9
|
+
static NSString *ERROR_CODE_FETCH_FAILURE = @"3";
|
|
9
10
|
|
|
10
11
|
static NSDictionary* getFileInfo(NSURL *url) {
|
|
11
12
|
|
|
@@ -58,6 +59,7 @@ static NSString* dictionary2JsonString(NSDictionary *dict) {
|
|
|
58
59
|
return @{
|
|
59
60
|
@"ERROR_CODE_DOWNLOAD_FAILURE": ERROR_CODE_DOWNLOAD_FAILURE,
|
|
60
61
|
@"ERROR_CODE_UPLOAD_FAILURE": ERROR_CODE_UPLOAD_FAILURE,
|
|
62
|
+
@"ERROR_CODE_FETCH_FAILURE": ERROR_CODE_FETCH_FAILURE,
|
|
61
63
|
};
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -187,4 +189,81 @@ RCT_EXPORT_METHOD(upload:(NSDictionary*)options resolve:(RCTPromiseResolveBlock)
|
|
|
187
189
|
|
|
188
190
|
}
|
|
189
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
|
+
|
|
190
269
|
@end
|