diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c96f0c..7d46f7b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.2.0 + +* 合并 pay 和 no_pay + ## 3.1.0 * 升级 Android SDK diff --git a/README.md b/README.md index 43bf6e4..16de673 100755 --- a/README.md +++ b/README.md @@ -94,12 +94,12 @@ dependencies: wechat_kit: ^${latestTag} ``` -或使用不包含 iOS 支付的版本: +使用包含 iOS 支付: ``` -dependencies: - # 请不要加 ^ - wechat_kit: ${latestTag}-iOS-NoPay +# 参考 https://github.com/RxReader/wechat_kit/blob/master/example/ios/Podfile +# 默认 no_pay +$WechatKitSubspec = 'pay' ``` * snapshot diff --git a/android/build.gradle b/android/build.gradle index 9ab3c3e..f365c04 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'io.github.v7lin.wechat_kit' -version '3.1.0' +version '3.2.0' buildscript { repositories { diff --git a/example/ios/Podfile b/example/ios/Podfile index f7d6a5e..cf0c493 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -27,6 +27,9 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe flutter_ios_podfile_setup +# 默认 no_pay +$WechatKitSubspec = 'pay' + target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end diff --git a/ios/wechat_kit.podspec b/ios/wechat_kit.podspec index 19896b8..9608d54 100644 --- a/ios/wechat_kit.podspec +++ b/ios/wechat_kit.podspec @@ -2,9 +2,16 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint wechat_kit.podspec' to validate before publishing. # + +if defined?($WechatKitSubspec) + wechat_kit_subspec = $WechatKitSubspec +else + wechat_kit_subspec = 'no_pay' +end + Pod::Spec.new do |s| s.name = 'wechat_kit' - s.version = '3.1.0' + s.version = '3.2.0' s.summary = 'WeChat SDKs as Flutter plugin.' s.description = <<-DESC A powerful Flutter plugin allowing developers to auth/share/pay with natvie Android & iOS WeChat SDKs. @@ -19,18 +26,29 @@ A powerful Flutter plugin allowing developers to auth/share/pay with natvie Andr s.platform = :ios, '8.0' s.static_framework = true - s.subspec 'vendor' do |sp| -# sp.source_files = 'Libraries/OpenSDK1.9.2/*.h' # For regular pay -# sp.public_header_files = 'Libraries/OpenSDK1.9.2/*.h' # For regular pay -# sp.vendored_libraries = 'Libraries/OpenSDK1.9.2/*.a' # For regular pay - sp.source_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h' # For NoPay - sp.public_header_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h' # For NoPay - sp.vendored_libraries = 'Libraries/OpenSDK1.9.2_NoPay/*.a' # For NoPay + # s.default_subspecs = :none + s.default_subspec = wechat_kit_subspec + + s.subspec 'pay' do |sp| + sp.source_files = 'Libraries/OpenSDK1.9.2/*.h' + sp.public_header_files = 'Libraries/OpenSDK1.9.2/*.h' + sp.vendored_libraries = 'Libraries/OpenSDK1.9.2/*.a' + sp.frameworks = 'CoreGraphics', 'Security', 'WebKit' + sp.libraries = 'c++', 'z', 'sqlite3.0' + sp.pod_target_xcconfig = { + 'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load', + } + end + + s.subspec 'no_pay' do |sp| + sp.source_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h' + sp.public_header_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h' + sp.vendored_libraries = 'Libraries/OpenSDK1.9.2_NoPay/*.a' sp.frameworks = 'CoreGraphics', 'Security', 'WebKit' sp.libraries = 'c++', 'z', 'sqlite3.0' sp.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load', - 'GCC_PREPROCESSOR_DEFINITIONS' => 'NO_PAY=1' # For NoPay + 'GCC_PREPROCESSOR_DEFINITIONS' => 'NO_PAY=1' } end diff --git a/lib/src/wechat.dart b/lib/src/wechat.dart index 6287598..00bd024 100755 --- a/lib/src/wechat.dart +++ b/lib/src/wechat.dart @@ -636,8 +636,11 @@ class Wechat { ); } - /// 支付 - x.y.z-iOS-NoPay 版本下 iOS 调用会直接抛出异常 No implementation [MissingPluginException] + /// 支付 - 不含「iOS 支付」调用会直接抛出异常 No implementation [MissingPluginException] /// 参数说明:https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_12&index=2 + /// + /// # 默认 no_pay,参考 https://github.com/RxReader/wechat_kit/blob/master/example/ios/Podfile + /// $WechatKitSubspec = 'pay' Future pay({ required String appId, required String partnerId, diff --git a/pubspec.yaml b/pubspec.yaml index 2593e22..6a4ec44 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: wechat_kit description: A powerful Flutter plugin allowing developers to auth/share/pay with natvie Android & iOS Wechat SDKs. -version: 3.1.0 +version: 3.2.0 # author: v7lin homepage: https://github.com/rxreader/wechat_kit