Skip to content

Commit e562aa2

Browse files
committed
合并 iOS-NoPay
1 parent 6b9aa84 commit e562aa2

File tree

7 files changed

+44
-16
lines changed

7 files changed

+44
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.2.0
2+
3+
* 合并 pay 和 no_pay
4+
15
## 3.1.0
26

37
* 升级 Android SDK

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ dependencies:
9494
wechat_kit: ^${latestTag}
9595
```
9696

97-
或使用不包含 iOS 支付的版本
97+
使用包含 iOS 支付
9898

9999
```
100-
dependencies:
101-
# 请不要加 ^
102-
wechat_kit: ${latestTag}-iOS-NoPay
100+
# 参考 https://github.com/RxReader/wechat_kit/blob/master/example/ios/Podfile
101+
# 默认 no_pay
102+
$WechatKitSubspec = 'pay'
103103
```
104104

105105
* snapshot

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'io.github.v7lin.wechat_kit'
2-
version '3.1.0'
2+
version '3.2.0'
33

44
buildscript {
55
repositories {

example/ios/Podfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2727

2828
flutter_ios_podfile_setup
2929

30+
# 默认 no_pay
31+
$WechatKitSubspec = 'pay'
32+
3033
target 'Runner' do
3134
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3235
end

ios/wechat_kit.podspec

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
33
# Run `pod lib lint wechat_kit.podspec' to validate before publishing.
44
#
5+
6+
if defined?($WechatKitSubspec)
7+
wechat_kit_subspec = $WechatKitSubspec
8+
else
9+
wechat_kit_subspec = 'no_pay'
10+
end
11+
512
Pod::Spec.new do |s|
613
s.name = 'wechat_kit'
7-
s.version = '3.1.0'
14+
s.version = '3.2.0'
815
s.summary = 'WeChat SDKs as Flutter plugin.'
916
s.description = <<-DESC
1017
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
1926
s.platform = :ios, '8.0'
2027

2128
s.static_framework = true
22-
s.subspec 'vendor' do |sp|
23-
# sp.source_files = 'Libraries/OpenSDK1.9.2/*.h' # For regular pay
24-
# sp.public_header_files = 'Libraries/OpenSDK1.9.2/*.h' # For regular pay
25-
# sp.vendored_libraries = 'Libraries/OpenSDK1.9.2/*.a' # For regular pay
26-
sp.source_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h' # For NoPay
27-
sp.public_header_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h' # For NoPay
28-
sp.vendored_libraries = 'Libraries/OpenSDK1.9.2_NoPay/*.a' # For NoPay
29+
# s.default_subspecs = :none
30+
s.default_subspec = wechat_kit_subspec
31+
32+
s.subspec 'pay' do |sp|
33+
sp.source_files = 'Libraries/OpenSDK1.9.2/*.h'
34+
sp.public_header_files = 'Libraries/OpenSDK1.9.2/*.h'
35+
sp.vendored_libraries = 'Libraries/OpenSDK1.9.2/*.a'
36+
sp.frameworks = 'CoreGraphics', 'Security', 'WebKit'
37+
sp.libraries = 'c++', 'z', 'sqlite3.0'
38+
sp.pod_target_xcconfig = {
39+
'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load',
40+
}
41+
end
42+
43+
s.subspec 'no_pay' do |sp|
44+
sp.source_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h'
45+
sp.public_header_files = 'Libraries/OpenSDK1.9.2_NoPay/*.h'
46+
sp.vendored_libraries = 'Libraries/OpenSDK1.9.2_NoPay/*.a'
2947
sp.frameworks = 'CoreGraphics', 'Security', 'WebKit'
3048
sp.libraries = 'c++', 'z', 'sqlite3.0'
3149
sp.pod_target_xcconfig = {
3250
'OTHER_LDFLAGS' => '$(inherited) -ObjC -all_load',
33-
'GCC_PREPROCESSOR_DEFINITIONS' => 'NO_PAY=1' # For NoPay
51+
'GCC_PREPROCESSOR_DEFINITIONS' => 'NO_PAY=1'
3452
}
3553
end
3654

lib/src/wechat.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,11 @@ class Wechat {
636636
);
637637
}
638638

639-
/// 支付 - x.y.z-iOS-NoPay 版本下 iOS 调用会直接抛出异常 No implementation [MissingPluginException]
639+
/// 支付 - 不含「iOS 支付」调用会直接抛出异常 No implementation [MissingPluginException]
640640
/// 参数说明:https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_12&index=2
641+
///
642+
/// # 默认 no_pay,参考 https://github.com/RxReader/wechat_kit/blob/master/example/ios/Podfile
643+
/// $WechatKitSubspec = 'pay'
641644
Future<void> pay({
642645
required String appId,
643646
required String partnerId,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_kit
22
description: A powerful Flutter plugin allowing developers to auth/share/pay with natvie Android & iOS Wechat SDKs.
3-
version: 3.1.0
3+
version: 3.2.0
44
# author: v7lin <v7lin@qq.com>
55
homepage: https://github.com/rxreader/wechat_kit
66

0 commit comments

Comments
 (0)