Browse Source

[modify]ios版本去掉支付宝sdk

Destiny 1 year ago
parent
commit
0ada44babd

+ 5 - 5
ios/Podfile.lock

@@ -72,7 +72,7 @@ PODS:
   - shared_preferences_foundation (0.0.1):
   - shared_preferences_foundation (0.0.1):
     - Flutter
     - Flutter
     - FlutterMacOS
     - FlutterMacOS
-  - sqflite (0.0.3):
+  - sqflite_darwin (0.0.4):
     - Flutter
     - Flutter
     - FlutterMacOS
     - FlutterMacOS
   - SwiftyGif (5.4.5)
   - SwiftyGif (5.4.5)
@@ -111,7 +111,7 @@ DEPENDENCIES:
   - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
   - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
   - record_darwin (from `.symlinks/plugins/record_darwin/ios`)
   - record_darwin (from `.symlinks/plugins/record_darwin/ios`)
   - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
   - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
-  - sqflite (from `.symlinks/plugins/sqflite/darwin`)
+  - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
   - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
   - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
   - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
   - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
   - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
   - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
@@ -158,8 +158,8 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/record_darwin/ios"
     :path: ".symlinks/plugins/record_darwin/ios"
   shared_preferences_foundation:
   shared_preferences_foundation:
     :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
     :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
-  sqflite:
-    :path: ".symlinks/plugins/sqflite/darwin"
+  sqflite_darwin:
+    :path: ".symlinks/plugins/sqflite_darwin/darwin"
   url_launcher_ios:
   url_launcher_ios:
     :path: ".symlinks/plugins/url_launcher_ios/ios"
     :path: ".symlinks/plugins/url_launcher_ios/ios"
   video_player_avfoundation:
   video_player_avfoundation:
@@ -192,7 +192,7 @@ SPEC CHECKSUMS:
   record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
   record_darwin: df0a677188e5fed18472550298e675f19ddaffbe
   SDWebImage: 981fd7e860af070920f249fd092420006014c3eb
   SDWebImage: 981fd7e860af070920f249fd092420006014c3eb
   shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
   shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
-  sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
+  sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13
   SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
   SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
   url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
   url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
   video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
   video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3

+ 19 - 0
ios/Runner/Info.plist

@@ -22,10 +22,29 @@
 	<string>$(FLUTTER_BUILD_NAME)</string>
 	<string>$(FLUTTER_BUILD_NAME)</string>
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<string>????</string>
+	<key>CFBundleURLTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>weixin</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>wxff40112d61011372</string>
+			</array>
+		</dict>
+	</array>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<false/>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>weixin</string>
+		<string>weixinULAPI</string>
+		<string>weixinURLParamsAPI</string>
+	</array>
 	<key>LSRequiresIPhoneOS</key>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<true/>
 	<key>NSAppTransportSecurity</key>
 	<key>NSAppTransportSecurity</key>

+ 4 - 0
ios/Runner/Runner.entitlements

@@ -4,5 +4,9 @@
 <dict>
 <dict>
 	<key>aps-environment</key>
 	<key>aps-environment</key>
 	<string>development</string>
 	<string>development</string>
+	<key>com.apple.developer.associated-domains</key>
+	<array>
+		<string>applinks:flutter.dev</string>
+	</array>
 </dict>
 </dict>
 </plist>
 </plist>

+ 4 - 4
lib/sdk/pay/agile_pay.dart

@@ -20,9 +20,10 @@ class AgilePay {
       AgilePayBefore? before}) {
       AgilePayBefore? before}) {
     IAgilePay? iAgilePay;
     IAgilePay? iAgilePay;
 
 
-    if (payInfo is AliPayInfo) {
-      iAgilePay = Alipay(payInfo);
-    } else if (payInfo is WechatPayInfo) {
+    // if (payInfo is AliPayInfo) {
+    //   iAgilePay = Alipay(payInfo);
+    // } else
+    if (payInfo is WechatPayInfo) {
       iAgilePay = WechatPay(payInfo);
       iAgilePay = WechatPay(payInfo);
     } else if (payInfo is ApplePayInfo) {
     } else if (payInfo is ApplePayInfo) {
       iAgilePay = ApplePay(payInfo);
       iAgilePay = ApplePay(payInfo);
@@ -42,5 +43,4 @@ class AgilePay {
           AgilePayCode.getMessageByCode(AgilePayCode.payCodeNotSupport));
           AgilePayCode.getMessageByCode(AgilePayCode.payCodeNotSupport));
     }
     }
   }
   }
-
 }
 }

+ 58 - 58
lib/sdk/pay/alipay/alipay.dart

@@ -1,58 +1,58 @@
-import 'dart:async';
-
-import 'package:flutter/widgets.dart';
-
-import '../assist/agile_pay_state_info.dart';
-import '../code/agile_pay_code.dart';
-import '../listener/i_agile_pay.dart';
-import 'ali_pay_info.dart';
-import 'package:alipay_kit/alipay_kit.dart';
-
-class Alipay extends AgilePayStateInfo implements IAgilePay {
-  final AliPayInfo _aliPayInfo;
-
-  late final StreamSubscription<AlipayResp> _paySubs;
-
-  Alipay(this._aliPayInfo) {
-    _paySubs = AlipayKitPlatform.instance.payResp().listen(_listenPay);
-  }
-
-  void _listenPay(AlipayResp resp) {
-    final String content = 'pay: ${resp.resultStatus} - ${resp.result}';
-    debugPrint('agilePay-alipay---> $content');
-    try {
-      int code = AgilePayCode.payCodeOtherError;
-      if (resp.resultStatus == AgilePayCode.payCodeAlipaySuccess) {
-        sendPaySuccess(resp.result);
-      } else {
-        if (resp.resultStatus != null &&
-            AgilePayCode.resultStatus.containsKey(resp.resultStatus)) {
-          code = resp.resultStatus!;
-        }
-        sendPayError(code, AgilePayCode.getMessageByCode(code));
-      }
-    } catch (e) {
-      sendError(AgilePayCode.payCodeOtherError,
-          AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
-    } finally {
-      dispose();
-    }
-  }
-
-  @override
-  void pay() {
-    sendPayBefore();
-    try {
-      AlipayKitPlatform.instance.pay(
-        orderInfo: _aliPayInfo.payInfo,
-      );
-    } catch (e) {
-      sendError(AgilePayCode.payCodePayError,
-          AgilePayCode.getMessageByCode(AgilePayCode.payCodePayError));
-    }
-  }
-
-  void dispose() {
-    _paySubs.cancel();
-  }
-}
+// import 'dart:async';
+
+// import 'package:flutter/widgets.dart';
+
+// import '../assist/agile_pay_state_info.dart';
+// import '../code/agile_pay_code.dart';
+// import '../listener/i_agile_pay.dart';
+// import 'ali_pay_info.dart';
+// import 'package:alipay_kit/alipay_kit.dart';
+
+// class Alipay extends AgilePayStateInfo implements IAgilePay {
+//   final AliPayInfo _aliPayInfo;
+
+//   late final StreamSubscription<AlipayResp> _paySubs;
+
+//   Alipay(this._aliPayInfo) {
+//     _paySubs = AlipayKitPlatform.instance.payResp().listen(_listenPay);
+//   }
+
+//   void _listenPay(AlipayResp resp) {
+//     final String content = 'pay: ${resp.resultStatus} - ${resp.result}';
+//     debugPrint('agilePay-alipay---> $content');
+//     try {
+//       int code = AgilePayCode.payCodeOtherError;
+//       if (resp.resultStatus == AgilePayCode.payCodeAlipaySuccess) {
+//         sendPaySuccess(resp.result);
+//       } else {
+//         if (resp.resultStatus != null &&
+//             AgilePayCode.resultStatus.containsKey(resp.resultStatus)) {
+//           code = resp.resultStatus!;
+//         }
+//         sendPayError(code, AgilePayCode.getMessageByCode(code));
+//       }
+//     } catch (e) {
+//       sendError(AgilePayCode.payCodeOtherError,
+//           AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
+//     } finally {
+//       dispose();
+//     }
+//   }
+
+//   @override
+//   void pay() {
+//     sendPayBefore();
+//     try {
+//       AlipayKitPlatform.instance.pay(
+//         orderInfo: _aliPayInfo.payInfo,
+//       );
+//     } catch (e) {
+//       sendError(AgilePayCode.payCodePayError,
+//           AgilePayCode.getMessageByCode(AgilePayCode.payCodePayError));
+//     }
+//   }
+
+//   void dispose() {
+//     _paySubs.cancel();
+//   }
+// }

+ 0 - 1
pubspec.yaml

@@ -101,7 +101,6 @@ dependencies:
     path: plugin/atmob_channel_reader
     path: plugin/atmob_channel_reader
 
 
   #支付
   #支付
-  alipay_kit: ^6.0.0
   wechat_kit: ^6.0.1
   wechat_kit: ^6.0.1
   in_app_purchase: ^3.2.0
   in_app_purchase: ^3.2.0