@greensoul/expo-native-wechat 0.4.0
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 +94 -0
- package/UPSTREAM.md +49 -0
- package/android/build/.transforms/8eaaf091b6b9d168861055549f685577/results.bin +1 -0
- package/android/build/.transforms/8eaaf091b6b9d168861055549f685577/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/expo/modules/nativewechat/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.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/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -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/java_res/debug/processDebugJavaRes/out/META-INF/greensoul-expo-native-wechat_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/expo/modules/nativewechat/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +16 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/greensoul-expo-native-wechat_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/AppPureSignContractParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/BasicRequestParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$2$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$6$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$7$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$7$onCoverDownloaded$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$8$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$8$onCoverDownloaded$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$9$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$1$9$onCoverDownloaded$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$10.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$11.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$12.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$13.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$14.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$15.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$16.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$17.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$18.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$19.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$20.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$21.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$22.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$23.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$24.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$25.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$26.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$27.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$28.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$29.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$30.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$7.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$8.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$Function$9.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule$definition$lambda$16$$inlined$FunctionWithoutArgs$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatUtils$DownloadBitmapCallback.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatUtils$downloadFileAsBitmap$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ExpoNativeWechatUtils.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/LaunchMiniprogramParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/NativeWechatRespDataHelper.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/OpenBusinessViewParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/OpenCustomerServiceParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/RegisterAppParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/RequestMerchantTransferParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/RequestPaymentParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/RequestSubscribeMsgParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/SendAuthRequestParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ShareImageParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ShareMiniProgramParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ShareTextParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ShareVideoParams.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/nativewechat/ShareWebpageParams.class +0 -0
- package/android/build.gradle +118 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/nativewechat/ExpoNativeWechatModule.kt +509 -0
- package/android/src/main/java/expo/modules/nativewechat/ExpoNativeWechatModuleParams.kt +229 -0
- package/android/src/main/java/expo/modules/nativewechat/ExpoNativeWechatUtils.kt +64 -0
- package/android/src/main/java/expo/modules/nativewechat/NativeWechatRespDataHelper.kt +64 -0
- package/app.plugin.js +173 -0
- package/build/hooks.d.ts +2 -0
- package/build/hooks.d.ts.map +1 -0
- package/build/hooks.js +12 -0
- package/build/hooks.js.map +1 -0
- package/build/index.d.ts +102 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +247 -0
- package/build/index.js.map +1 -0
- package/build/module.d.ts +3 -0
- package/build/module.d.ts.map +1 -0
- package/build/module.js +5 -0
- package/build/module.js.map +1 -0
- package/build/notification.d.ts +12 -0
- package/build/notification.d.ts.map +1 -0
- package/build/notification.js +33 -0
- package/build/notification.js.map +1 -0
- package/build/typing.d.ts +41 -0
- package/build/typing.d.ts.map +1 -0
- package/build/typing.js +2 -0
- package/build/typing.js.map +1 -0
- package/build/utils.d.ts +4 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +9 -0
- package/build/utils.js.map +1 -0
- package/expo-module.config.json +10 -0
- package/ios/ExpoNativeWechat-Bridging-Header.h +10 -0
- package/ios/ExpoNativeWechat.h +19 -0
- package/ios/ExpoNativeWechat.podspec +28 -0
- package/ios/ExpoNativeWechatLogger.h +17 -0
- package/ios/ExpoNativeWechatLogger.m +26 -0
- package/ios/ExpoNativeWechatModule.swift +392 -0
- package/ios/ExpoNativeWechatModuleParams.swift +230 -0
- package/ios/ExpoWechatDelegate.swift +30 -0
- package/ios/ExpoWechatUtils.swift +60 -0
- package/ios/RespDataHelper.h +8 -0
- package/ios/RespDataHelper.m +54 -0
- package/ios/ResponseHandler.h +15 -0
- package/ios/ResponseHandler.m +22 -0
- package/package.json +60 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { LegacyEventEmitter as EventEmitter } from "expo-modules-core";
|
|
2
|
+
import NativeModule from "./module";
|
|
3
|
+
import Notification from "./notification";
|
|
4
|
+
import { executeNativeFunction } from "./utils";
|
|
5
|
+
export * from "./hooks";
|
|
6
|
+
export * from "./typing";
|
|
7
|
+
const emitter = new EventEmitter(NativeModule);
|
|
8
|
+
const notification = new Notification();
|
|
9
|
+
let registered = false;
|
|
10
|
+
const generateError = (response) => new Error(`[Native Wechat]: (${response.errorCode}) ${response.errorStr}`);
|
|
11
|
+
const assertRegisteration = (name) => {
|
|
12
|
+
if (!registered) {
|
|
13
|
+
throw new Error(`Please register SDK before invoking ${name}`);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export const checkUniversalLinkReady = () => {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
const id = executeNativeFunction(NativeModule.checkUniversalLinkReady)();
|
|
19
|
+
notification.once(id, (error, data) => {
|
|
20
|
+
if (error)
|
|
21
|
+
reject(error);
|
|
22
|
+
resolve(data);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
export const registerApp = (request) => {
|
|
27
|
+
if (registered) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
emitter.addListener("ResponseData", (response) => {
|
|
31
|
+
const error = response.errorCode ? generateError(response) : null;
|
|
32
|
+
notification.dispatch(response.id, error, response);
|
|
33
|
+
});
|
|
34
|
+
emitter.addListener("ResponseFromNotification", (response) => {
|
|
35
|
+
const error = response.errorCode ? generateError(response) : null;
|
|
36
|
+
notification.dispatch(response.type, error, response);
|
|
37
|
+
});
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
const id = executeNativeFunction(NativeModule.registerApp)(request);
|
|
40
|
+
notification.once(id, (error, data) => {
|
|
41
|
+
if (error)
|
|
42
|
+
reject(error);
|
|
43
|
+
registered = true;
|
|
44
|
+
resolve(data);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
export const isWechatInstalled = () => {
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
const id = executeNativeFunction(NativeModule.isWechatInstalled)();
|
|
51
|
+
notification.once(id, (error, data) => {
|
|
52
|
+
if (error)
|
|
53
|
+
reject(error);
|
|
54
|
+
resolve(data);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
export const sendAuthRequest = (request = {
|
|
59
|
+
scope: "snsapi_userinfo",
|
|
60
|
+
state: "",
|
|
61
|
+
}) => {
|
|
62
|
+
assertRegisteration("sendAuthRequest");
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
const id = executeNativeFunction(NativeModule.sendAuthRequest)(request);
|
|
65
|
+
notification.once(id, (error) => {
|
|
66
|
+
if (error) {
|
|
67
|
+
return reject(error);
|
|
68
|
+
}
|
|
69
|
+
notification.once("SendAuthResp", (error, data) => {
|
|
70
|
+
if (error) {
|
|
71
|
+
return reject(error);
|
|
72
|
+
}
|
|
73
|
+
return resolve(data);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export const shareText = (request) => {
|
|
79
|
+
assertRegisteration("shareText");
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
const id = executeNativeFunction(NativeModule.shareText)(request);
|
|
82
|
+
notification.once(id, (error, data) => {
|
|
83
|
+
if (error)
|
|
84
|
+
reject(error);
|
|
85
|
+
resolve(data);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
export const shareImage = (request) => {
|
|
90
|
+
assertRegisteration("shareImage");
|
|
91
|
+
return new Promise((resolve, reject) => {
|
|
92
|
+
const id = executeNativeFunction(NativeModule.shareImage)(request);
|
|
93
|
+
notification.once(id, (error, data) => {
|
|
94
|
+
if (error)
|
|
95
|
+
reject(error);
|
|
96
|
+
resolve(data);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
export const shareVideo = (request) => {
|
|
101
|
+
assertRegisteration("shareVideo");
|
|
102
|
+
return new Promise((resolve, reject) => {
|
|
103
|
+
const id = executeNativeFunction(NativeModule.shareVideo)(request);
|
|
104
|
+
notification.once(id, (error, data) => {
|
|
105
|
+
if (error)
|
|
106
|
+
reject(error);
|
|
107
|
+
resolve(data);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
export const shareWebpage = (request) => {
|
|
112
|
+
assertRegisteration("shareWebpage");
|
|
113
|
+
return new Promise((resolve, reject) => {
|
|
114
|
+
const id = executeNativeFunction(NativeModule.shareWebpage)(request);
|
|
115
|
+
notification.once(id, (error, data) => {
|
|
116
|
+
if (error)
|
|
117
|
+
reject(error);
|
|
118
|
+
resolve(data);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
export const shareMiniProgram = (request) => {
|
|
123
|
+
assertRegisteration("shareMiniProgram");
|
|
124
|
+
return new Promise((resolve, reject) => {
|
|
125
|
+
const id = executeNativeFunction(NativeModule.shareMiniProgram)(request);
|
|
126
|
+
notification.once(id, (error, data) => {
|
|
127
|
+
if (error)
|
|
128
|
+
reject(error);
|
|
129
|
+
resolve(data);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
export const requestPayment = (request) => {
|
|
134
|
+
assertRegisteration("requestPayment");
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
const id = executeNativeFunction(NativeModule.requestPayment)(request);
|
|
137
|
+
notification.once(id, (error) => {
|
|
138
|
+
if (error) {
|
|
139
|
+
return reject(error);
|
|
140
|
+
}
|
|
141
|
+
notification.once("PayResp", (error, data) => {
|
|
142
|
+
if (error) {
|
|
143
|
+
return reject(error);
|
|
144
|
+
}
|
|
145
|
+
return resolve(data);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
export const requestSubscribeMessage = (request) => {
|
|
151
|
+
assertRegisteration("requestSubscribeMessage");
|
|
152
|
+
return new Promise((resolve, reject) => {
|
|
153
|
+
const id = executeNativeFunction(NativeModule.requestSubscribeMessage)(request);
|
|
154
|
+
notification.once(id, (error, data) => {
|
|
155
|
+
if (error)
|
|
156
|
+
reject(error);
|
|
157
|
+
resolve(data);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
export const openCustomerService = (request) => {
|
|
162
|
+
assertRegisteration("openCustomerService");
|
|
163
|
+
return new Promise((resolve, reject) => {
|
|
164
|
+
const id = executeNativeFunction(NativeModule.openCustomerService)(request);
|
|
165
|
+
notification.once(id, (error, data) => {
|
|
166
|
+
if (error)
|
|
167
|
+
reject(error);
|
|
168
|
+
resolve(data);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
export const launchMiniProgram = (request) => {
|
|
173
|
+
assertRegisteration("launchMiniProgram");
|
|
174
|
+
return new Promise((resolve, reject) => {
|
|
175
|
+
const id = executeNativeFunction(NativeModule.launchMiniProgram)(request);
|
|
176
|
+
notification.once(id, (error, data) => {
|
|
177
|
+
if (error)
|
|
178
|
+
reject(error);
|
|
179
|
+
resolve(data);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export const appPureSignContract = (request) => {
|
|
184
|
+
assertRegisteration("appPureSignContract");
|
|
185
|
+
return new Promise((resolve, reject) => {
|
|
186
|
+
const id = executeNativeFunction(NativeModule.appPureSignContract)(request);
|
|
187
|
+
notification.once(id, (error, data) => {
|
|
188
|
+
if (error)
|
|
189
|
+
reject(error);
|
|
190
|
+
resolve(data);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
export const requestMerchantTransfer = (request) => {
|
|
195
|
+
assertRegisteration("requestMerchantTransfer");
|
|
196
|
+
return new Promise((resolve, reject) => {
|
|
197
|
+
const id = executeNativeFunction(NativeModule.requestMerchantTransfer)(request);
|
|
198
|
+
notification.once(id, (error) => {
|
|
199
|
+
if (error) {
|
|
200
|
+
return reject(error);
|
|
201
|
+
}
|
|
202
|
+
notification.once("WXOpenBusinessViewResp", (error, data) => {
|
|
203
|
+
if (error) {
|
|
204
|
+
return reject(error);
|
|
205
|
+
}
|
|
206
|
+
return resolve(data);
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* 通用的 openBusinessView 接口
|
|
213
|
+
* 支持所有 businessType,如 'mp_business_type', 'wxpayScoreDetail', 'wxpayScoreEnable' 等
|
|
214
|
+
*
|
|
215
|
+
* @param request.businessType - 业务类型,如 'mp_business_type'
|
|
216
|
+
* @param request.query - URL query string 格式的参数
|
|
217
|
+
* @param request.extInfo - 可选的扩展信息
|
|
218
|
+
*/
|
|
219
|
+
export const openBusinessView = (request) => {
|
|
220
|
+
assertRegisteration("openBusinessView");
|
|
221
|
+
return new Promise((resolve, reject) => {
|
|
222
|
+
const id = executeNativeFunction(NativeModule.openBusinessView)(request);
|
|
223
|
+
notification.once(id, (error) => {
|
|
224
|
+
if (error) {
|
|
225
|
+
return reject(error);
|
|
226
|
+
}
|
|
227
|
+
notification.once("WXOpenBusinessViewResp", (error, data) => {
|
|
228
|
+
if (error) {
|
|
229
|
+
return reject(error);
|
|
230
|
+
}
|
|
231
|
+
return resolve(data);
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
export const NativeWechatConstants = NativeModule.getConstants();
|
|
237
|
+
export const NativeWechatShareScene = {
|
|
238
|
+
WXSceneSession: NativeWechatConstants.WXSceneSession,
|
|
239
|
+
WXSceneTimeline: NativeWechatConstants.WXSceneTimeline,
|
|
240
|
+
WXSceneFavorite: NativeWechatConstants.WXSceneFavorite,
|
|
241
|
+
};
|
|
242
|
+
export const NativeWechatMiniprogramType = {
|
|
243
|
+
WXMiniProgramTypeRelease: NativeWechatConstants.WXMiniProgramTypeRelease,
|
|
244
|
+
WXMiniProgramTypeTest: NativeWechatConstants.WXMiniProgramTypeTest,
|
|
245
|
+
WXMiniProgramTypePreview: NativeWechatConstants.WXMiniProgramTypePreview,
|
|
246
|
+
};
|
|
247
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mapp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E,CAAC;oBACV,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvB,CAAC;gBAED,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAChC,YAAY,CAAC,YAAY,EAAiC,CAAC;AAE7D,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,cAAc,EAAE,qBAAqB,CAAC,cAAc;IACpD,eAAe,EAAE,qBAAqB,CAAC,eAAe;IACtD,eAAe,EAAE,qBAAqB,CAAC,eAAe;CACvD,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,wBAAwB,EAAE,qBAAqB,CAAC,wBAAwB;IACxE,qBAAqB,EAAE,qBAAqB,CAAC,qBAAqB;IAClE,wBAAwB,EAAE,qBAAqB,CAAC,wBAAwB;CACzE,CAAC","sourcesContent":["import { LegacyEventEmitter as EventEmitter } from \"expo-modules-core\";\n\nimport NativeModule from \"./module\";\nimport Notification from \"./notification\";\nimport {\n NativeWechatModuleConstants,\n NativeWechatResponse,\n SendAuthRequestResponse,\n LaunchMiniProgramResponse,\n UniversalLinkCheckingResponse,\n RequestMerchantTransferResponse,\n OpenBusinessViewResponse,\n} from \"./typing\";\nimport { executeNativeFunction } from \"./utils\";\nexport * from \"./hooks\";\nexport * from \"./typing\";\n\nconst emitter = new EventEmitter(NativeModule);\n\nconst notification = new Notification();\n\nlet registered = false;\n\nconst generateError = (response: NativeWechatResponse) =>\n new Error(`[Native Wechat]: (${response.errorCode}) ${response.errorStr}`);\n\nconst assertRegisteration = (name: string) => {\n if (!registered) {\n throw new Error(`Please register SDK before invoking ${name}`);\n }\n};\n\nexport const checkUniversalLinkReady = () => {\n return new Promise<UniversalLinkCheckingResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.checkUniversalLinkReady)();\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const registerApp = (request: {\n appid: string;\n universalLink?: string;\n log?: boolean;\n logPrefix?: string;\n}) => {\n if (registered) {\n return;\n }\n\n emitter.addListener(\"ResponseData\", (response: NativeWechatResponse) => {\n const error = response.errorCode ? generateError(response) : null;\n\n notification.dispatch(response.id!, error, response);\n });\n\n emitter.addListener(\n \"ResponseFromNotification\",\n (response: NativeWechatResponse) => {\n const error = response.errorCode ? generateError(response) : null;\n\n notification.dispatch(response.type!, error, response);\n },\n );\n\n return new Promise<boolean>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.registerApp)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n registered = true;\n\n resolve(data);\n });\n });\n};\n\nexport const isWechatInstalled = () => {\n return new Promise<boolean>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.isWechatInstalled)();\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const sendAuthRequest = (\n request: { scope: string; state?: string } = {\n scope: \"snsapi_userinfo\",\n state: \"\",\n },\n) => {\n assertRegisteration(\"sendAuthRequest\");\n\n return new Promise<SendAuthRequestResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.sendAuthRequest)(request);\n\n notification.once(id, (error) => {\n if (error) {\n return reject(error);\n }\n\n notification.once(\"SendAuthResp\", (error, data) => {\n if (error) {\n return reject(error);\n }\n\n return resolve(data);\n });\n });\n });\n};\n\nexport const shareText = (request: { text: string; scene: number }) => {\n assertRegisteration(\"shareText\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.shareText)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const shareImage = (request: { src: string; scene: number }) => {\n assertRegisteration(\"shareImage\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.shareImage)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const shareVideo = (request: {\n title?: string;\n description?: string;\n scene: number;\n videoUrl: string;\n videoLowBandUrl?: string;\n coverUrl?: string;\n}) => {\n assertRegisteration(\"shareVideo\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.shareVideo)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const shareWebpage = (request: {\n title?: string;\n description?: string;\n scene: number;\n webpageUrl: string;\n coverUrl?: string;\n}) => {\n assertRegisteration(\"shareWebpage\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.shareWebpage)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const shareMiniProgram = (request: {\n userName: string;\n path: string;\n miniprogramType: number;\n webpageUrl: string;\n withShareTicket?: boolean;\n title?: string;\n description?: string;\n coverUrl?: string;\n}) => {\n assertRegisteration(\"shareMiniProgram\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.shareMiniProgram)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const requestPayment = (request: {\n partnerId: string;\n prepayId: string;\n nonceStr: string;\n timeStamp: string;\n sign: string;\n}) => {\n assertRegisteration(\"requestPayment\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.requestPayment)(request);\n\n notification.once(id, (error) => {\n if (error) {\n return reject(error);\n }\n\n notification.once(\"PayResp\", (error, data) => {\n if (error) {\n return reject(error);\n }\n\n return resolve(data);\n });\n });\n });\n};\n\nexport const requestSubscribeMessage = (request: {\n scene: number;\n templateId: string;\n reserved?: string;\n}) => {\n assertRegisteration(\"requestSubscribeMessage\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.requestSubscribeMessage)(\n request,\n );\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const openCustomerService = (request: {\n corpid: string;\n url: string;\n}) => {\n assertRegisteration(\"openCustomerService\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.openCustomerService)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const launchMiniProgram = (request: {\n userName: string;\n path: string;\n miniProgramType: number;\n onNavBack?: (res: LaunchMiniProgramResponse) => void;\n}) => {\n assertRegisteration(\"launchMiniProgram\");\n\n return new Promise<LaunchMiniProgramResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.launchMiniProgram)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const appPureSignContract = (request: {\n preEntrustwebId: string;\n}) => {\n assertRegisteration(\"appPureSignContract\");\n\n return new Promise<NativeWechatResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.appPureSignContract)(request);\n\n notification.once(id, (error, data) => {\n if (error) reject(error);\n\n resolve(data);\n });\n });\n};\n\nexport const requestMerchantTransfer = (request: {\n mchId: string;\n packageStr: string;\n}) => {\n assertRegisteration(\"requestMerchantTransfer\");\n\n return new Promise<RequestMerchantTransferResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.requestMerchantTransfer)(\n request\n );\n\n notification.once(id, (error) => {\n if (error) {\n return reject(error);\n }\n\n notification.once(\"WXOpenBusinessViewResp\", (error, data) => {\n if (error) {\n return reject(error);\n }\n\n return resolve(data);\n });\n });\n });\n};\n\n/**\n * 通用的 openBusinessView 接口\n * 支持所有 businessType,如 'mp_business_type', 'wxpayScoreDetail', 'wxpayScoreEnable' 等\n * \n * @param request.businessType - 业务类型,如 'mp_business_type'\n * @param request.query - URL query string 格式的参数\n * @param request.extInfo - 可选的扩展信息\n */\nexport const openBusinessView = (request: {\n businessType: string;\n query: string;\n extInfo?: string;\n}) => {\n assertRegisteration(\"openBusinessView\");\n\n return new Promise<OpenBusinessViewResponse>((resolve, reject) => {\n const id = executeNativeFunction(NativeModule.openBusinessView)(request);\n\n notification.once(id, (error) => {\n if (error) {\n return reject(error);\n }\n\n notification.once(\"WXOpenBusinessViewResp\", (error, data) => {\n if (error) {\n return reject(error);\n }\n\n return resolve(data);\n });\n });\n });\n};\n\nexport const NativeWechatConstants =\n NativeModule.getConstants() as NativeWechatModuleConstants;\n\nexport const NativeWechatShareScene = {\n WXSceneSession: NativeWechatConstants.WXSceneSession,\n WXSceneTimeline: NativeWechatConstants.WXSceneTimeline,\n WXSceneFavorite: NativeWechatConstants.WXSceneFavorite,\n};\n\nexport const NativeWechatMiniprogramType = {\n WXMiniProgramTypeRelease: NativeWechatConstants.WXMiniProgramTypeRelease,\n WXMiniProgramTypeTest: NativeWechatConstants.WXMiniProgramTypeTest,\n WXMiniProgramTypePreview: NativeWechatConstants.WXMiniProgramTypePreview,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";AAIA,wBAAuD"}
|
package/build/module.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
+
// It loads the native module object from the JSI or falls back to
|
|
3
|
+
// the bridge module (from NativeModulesProxy) if the remote debugger is on.
|
|
4
|
+
export default requireNativeModule('ExpoNativeWechat');
|
|
5
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,kEAAkE;AAClE,4EAA4E;AAC5E,eAAe,mBAAmB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\n// It loads the native module object from the JSI or falls back to\n// the bridge module (from NativeModulesProxy) if the remote debugger is on.\nexport default requireNativeModule('ExpoNativeWechat');\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Handler = (...args: any[]) => void;
|
|
2
|
+
declare class Notification {
|
|
3
|
+
private handlers;
|
|
4
|
+
constructor();
|
|
5
|
+
private getQueue;
|
|
6
|
+
listen(name: string, handler: Handler): void;
|
|
7
|
+
once(name: string, handler: Handler): void;
|
|
8
|
+
clear(name: string): void;
|
|
9
|
+
dispatch(name: string, ...args: any[]): void;
|
|
10
|
+
}
|
|
11
|
+
export default Notification;
|
|
12
|
+
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../src/notification.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAExC,cAAM,YAAY;IAChB,OAAO,CAAC,QAAQ,CAAyB;;IAMzC,OAAO,CAAC,QAAQ;IAYhB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAMrC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAInC,KAAK,CAAC,IAAI,EAAE,MAAM;IAIlB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;CAOtC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class Notification {
|
|
2
|
+
handlers;
|
|
3
|
+
constructor() {
|
|
4
|
+
this.handlers = new Map();
|
|
5
|
+
}
|
|
6
|
+
getQueue(name) {
|
|
7
|
+
const queue = this.handlers.get(name);
|
|
8
|
+
if (!queue) {
|
|
9
|
+
this.handlers.set(name, []);
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return queue;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
listen(name, handler) {
|
|
17
|
+
const queue = this.getQueue(name);
|
|
18
|
+
this.handlers.set(name, queue.concat(handler));
|
|
19
|
+
}
|
|
20
|
+
once(name, handler) {
|
|
21
|
+
this.handlers.set(name, [handler]);
|
|
22
|
+
}
|
|
23
|
+
clear(name) {
|
|
24
|
+
this.handlers.set(name, []);
|
|
25
|
+
}
|
|
26
|
+
dispatch(name, ...args) {
|
|
27
|
+
const queue = this.getQueue(name);
|
|
28
|
+
queue.forEach(fn => fn(...args));
|
|
29
|
+
this.clear(name);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export default Notification;
|
|
33
|
+
//# sourceMappingURL=notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../src/notification.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY;IACR,QAAQ,CAAyB;IAEzC;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;IAEO,QAAQ,CAAC,IAAY;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAE5B,OAAO,EAAE,CAAC;QACZ,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,OAAgB;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,OAAgB;QACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,IAAY;QAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,QAAQ,CAAC,IAAY,EAAE,GAAG,IAAW;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAElC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;CACF;AAED,eAAe,YAAY,CAAC","sourcesContent":["type Handler = (...args: any[]) => void;\n\nclass Notification {\n private handlers: Map<string, Handler[]>;\n\n constructor() {\n this.handlers = new Map();\n }\n\n private getQueue(name: string) {\n const queue = this.handlers.get(name);\n\n if (!queue) {\n this.handlers.set(name, []);\n\n return [];\n } else {\n return queue;\n }\n }\n\n listen(name: string, handler: Handler) {\n const queue = this.getQueue(name);\n\n this.handlers.set(name, queue.concat(handler));\n }\n\n once(name: string, handler: Handler) {\n this.handlers.set(name, [handler]);\n }\n\n clear(name: string) {\n this.handlers.set(name, []);\n }\n\n dispatch(name: string, ...args: any[]) {\n const queue = this.getQueue(name);\n\n queue.forEach(fn => fn(...args));\n\n this.clear(name);\n }\n}\n\nexport default Notification;\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type Recordable = Record<string, any>;
|
|
2
|
+
export type NativeWechatResponse<T = any> = {
|
|
3
|
+
id?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
errorCode: number;
|
|
6
|
+
errorStr: string | null;
|
|
7
|
+
data: T;
|
|
8
|
+
};
|
|
9
|
+
export type UniversalLinkCheckingResponse = {
|
|
10
|
+
suggestion: string;
|
|
11
|
+
errorInfo: string;
|
|
12
|
+
};
|
|
13
|
+
export type SendAuthRequestResponse = NativeWechatResponse<{
|
|
14
|
+
code: string;
|
|
15
|
+
country: string;
|
|
16
|
+
lang: string;
|
|
17
|
+
state: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type LaunchMiniProgramResponse = NativeWechatResponse<{
|
|
20
|
+
extMsg?: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type RequestMerchantTransferResponse = NativeWechatResponse<{
|
|
23
|
+
businessType: string;
|
|
24
|
+
extMsg: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type OpenBusinessViewResponse = NativeWechatResponse<{
|
|
27
|
+
businessType: string;
|
|
28
|
+
extMsg: string;
|
|
29
|
+
}>;
|
|
30
|
+
export type WechatShareScene = {
|
|
31
|
+
WXSceneSession: number;
|
|
32
|
+
WXSceneTimeline: number;
|
|
33
|
+
WXSceneFavorite: number;
|
|
34
|
+
};
|
|
35
|
+
export type WechatMiniprogramType = {
|
|
36
|
+
WXMiniProgramTypeRelease: number;
|
|
37
|
+
WXMiniProgramTypeTest: number;
|
|
38
|
+
WXMiniProgramTypePreview: number;
|
|
39
|
+
};
|
|
40
|
+
export type NativeWechatModuleConstants = WechatShareScene & WechatMiniprogramType;
|
|
41
|
+
//# sourceMappingURL=typing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typing.d.ts","sourceRoot":"","sources":["../src/typing.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE7C,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,GAAG,IAAI;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,oBAAoB,CAAC;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAGH,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GACxD,qBAAqB,CAAC"}
|
package/build/typing.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typing.js","sourceRoot":"","sources":["../src/typing.ts"],"names":[],"mappings":"","sourcesContent":["export type Recordable = Record<string, any>;\n\nexport type NativeWechatResponse<T = any> = {\n id?: string;\n type?: string;\n errorCode: number;\n errorStr: string | null;\n data: T;\n};\n\nexport type UniversalLinkCheckingResponse = {\n suggestion: string;\n errorInfo: string;\n};\n\nexport type SendAuthRequestResponse = NativeWechatResponse<{\n code: string;\n country: string;\n lang: string;\n state: string;\n}>;\n\nexport type LaunchMiniProgramResponse = NativeWechatResponse<{\n extMsg?: string;\n}>;\n\nexport type RequestMerchantTransferResponse = NativeWechatResponse<{\n businessType: string;\n extMsg: string;\n}>;\n\n// OpenBusinessView 通用类型\nexport type OpenBusinessViewResponse = NativeWechatResponse<{\n businessType: string;\n extMsg: string;\n}>;\n\nexport type WechatShareScene = {\n WXSceneSession: number;\n WXSceneTimeline: number;\n WXSceneFavorite: number;\n};\n\nexport type WechatMiniprogramType = {\n WXMiniProgramTypeRelease: number;\n WXMiniProgramTypeTest: number;\n WXMiniProgramTypePreview: number;\n};\n\nexport type NativeWechatModuleConstants = WechatShareScene &\n WechatMiniprogramType;\n"]}
|
package/build/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,YAAY,cAAsD,CAAC;AAEhF,eAAO,MAAM,qBAAqB,GAAI,IAAI,QAAQ,MACxC,OAAM,UAAe,WAO9B,CAAC"}
|
package/build/utils.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const getRamdomStr = () => (Math.random() + 1).toString(36).substring(7);
|
|
2
|
+
export const executeNativeFunction = (fn) => {
|
|
3
|
+
return (args = {}) => {
|
|
4
|
+
const id = getRamdomStr();
|
|
5
|
+
fn({ ...args, id });
|
|
6
|
+
return id;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAY,EAAE,EAAE;IACpD,OAAO,CAAC,OAAmB,EAAE,EAAE,EAAE;QAC/B,MAAM,EAAE,GAAG,YAAY,EAAE,CAAC;QAE1B,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAEpB,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Recordable } from \"./typing\";\n\nexport const getRamdomStr = () => (Math.random() + 1).toString(36).substring(7);\n\nexport const executeNativeFunction = (fn: Function) => {\n return (args: Recordable = {}) => {\n const id = getRamdomStr();\n\n fn({ ...args, id });\n\n return id;\n };\n};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ExpoNativeWechat.h
|
|
3
|
+
// ExpoNativeWechat
|
|
4
|
+
//
|
|
5
|
+
// Umbrella header for the ExpoNativeWechat module.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
//! Project version number for ExpoNativeWechat.
|
|
11
|
+
FOUNDATION_EXPORT double ExpoNativeWechatVersionNumber;
|
|
12
|
+
|
|
13
|
+
//! Project version string for ExpoNativeWechat.
|
|
14
|
+
FOUNDATION_EXPORT const unsigned char ExpoNativeWechatVersionString[];
|
|
15
|
+
|
|
16
|
+
// Import public headers
|
|
17
|
+
#import "ExpoNativeWechatLogger.h"
|
|
18
|
+
#import "RespDataHelper.h"
|
|
19
|
+
#import "ResponseHandler.h"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ExpoNativeWechat'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platforms = { :ios => '13.4', :tvos => '13.4' }
|
|
14
|
+
s.swift_version = '5.4'
|
|
15
|
+
s.source = { git: 'https://github.com/Hector-Chong/expo-native-wechat' }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
s.dependency "WechatOpenSDK"
|
|
20
|
+
|
|
21
|
+
# Swift/Objective-C compatibility
|
|
22
|
+
s.pod_target_xcconfig = {
|
|
23
|
+
'DEFINES_MODULE' => 'YES',
|
|
24
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
s.source_files = "**/*.{h,m,swift}"
|
|
28
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ExpoNativeWechatLogger.h
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
// Created by Hector Chong on 4/7/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "WXApi.h"
|
|
10
|
+
|
|
11
|
+
@interface ExpoNativeWechatLogger : NSObject <WXApiLogDelegate>
|
|
12
|
+
|
|
13
|
+
@property (nonatomic, nonnull) NSString* logPrefix;
|
|
14
|
+
|
|
15
|
+
- (nonnull instancetype)initWithPrefix:(nonnull NSString *) prefix;
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ExpoNativeWechatLogger.m
|
|
3
|
+
// ExpoNativeWechat
|
|
4
|
+
//
|
|
5
|
+
// Created by Hector Chong on 4/7/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "ExpoNativeWechatLogger.h"
|
|
9
|
+
|
|
10
|
+
@implementation ExpoNativeWechatLogger
|
|
11
|
+
|
|
12
|
+
- (instancetype)initWithPrefix:(NSString *)prefix {
|
|
13
|
+
self = [self init];
|
|
14
|
+
|
|
15
|
+
if(self){
|
|
16
|
+
_logPrefix = prefix;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return self;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
- (void)onLog:(nonnull NSString *)log logLevel:(WXLogLevel)level {
|
|
23
|
+
NSLog([NSString stringWithFormat:@"%@%@: ", _logPrefix, @" %@"], log);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@end
|