Skip to content

Commit

Permalink
🚀 [iOS] Default to pay (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Apr 25, 2022
1 parent e562aa2 commit e91670f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ iOS 9系统策略更新,限制了http协议的访问,此外应用需要在
```plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>weixinULAPI</string>
<string>weixin</string>
<string>weixinULAPI</string>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
```

Expand All @@ -94,12 +94,10 @@ dependencies:
wechat_kit: ^${latestTag}
```

使用包含 iOS 支付
若需要不包含支付的 iOS SDK,请修改项目下的 `ios/Podfile`

```
# 参考 https://github.com/RxReader/wechat_kit/blob/master/example/ios/Podfile
# 默认 no_pay
$WechatKitSubspec = 'pay'
```diff
+ $WechatKitSubspec = 'no_pay'
```

* snapshot
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe

flutter_ios_podfile_setup

# 默认 no_pay
$WechatKitSubspec = 'pay'
# 默认 pay
# $WechatKitSubspec = 'no_pay'

target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
Expand Down
6 changes: 3 additions & 3 deletions ios/wechat_kit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
if defined?($WechatKitSubspec)
wechat_kit_subspec = $WechatKitSubspec
else
wechat_kit_subspec = 'no_pay'
wechat_kit_subspec = 'pay'
end
Pod::Spec.new do |s|
s.name = 'wechat_kit'
s.version = '3.2.0'
s.summary = 'WeChat SDKs as Flutter plugin.'
s.summary = 'The Flutter plugin for WeChat SDKs.'
s.description = <<-DESC
A powerful Flutter plugin allowing developers to auth/share/pay with natvie Android & iOS WeChat SDKs.
A powerful Flutter plugin allowing developers to auth/pay/share with native Android & iOS WeChat SDKs.
DESC
s.homepage = 'https://github.com/RxReader/wechat_kit'
s.license = { :file => '../LICENSE' }
Expand Down
8 changes: 5 additions & 3 deletions lib/src/wechat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,13 @@ class Wechat {
);
}

/// 支付 - 不含「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'
/// * 默认包含支付,参考 https://github.com/RxReader/wechat_kit/blob/master/example/ios/Podfile
/// 修改 `$WechatKitSubspec = 'no_pay'` 可切换为不包含支付。
/// * 不含「iOS 支付」调用会抛出 [MissingPluginException]
Future<void> pay({
required String appId,
required String partnerId,
Expand Down

0 comments on commit e91670f

Please sign in to comment.