Skip to content

Commit

Permalink
合并 iOS-NoPay
Browse files Browse the repository at this point in the history
  • Loading branch information
droplet-js committed Apr 20, 2022
1 parent 6b9aa84 commit e562aa2
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.2.0

* 合并 pay 和 no_pay

## 3.1.0

* 升级 Android SDK
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'io.github.v7lin.wechat_kit'
version '3.1.0'
version '3.2.0'

buildscript {
repositories {
Expand Down
3 changes: 3 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 27 additions & 9 deletions ios/wechat_kit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
5 changes: 4 additions & 1 deletion lib/src/wechat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> pay({
required String appId,
required String partnerId,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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 <v7lin@qq.com>
homepage: https://github.com/rxreader/wechat_kit

Expand Down

0 comments on commit e562aa2

Please sign in to comment.