feat: 增加ios支付&ui修改
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
import Libcore
|
||||
|
||||
import PassKit
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
|
||||
@@ -12,9 +12,22 @@ import Libcore
|
||||
setupFileManager()
|
||||
registerHandlers()
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
|
||||
// ✅ Apple Pay 调试代码
|
||||
debugApplePaySupport()
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
func debugApplePaySupport() {
|
||||
// 是否能使用 Apple Pay(设备是否支持)
|
||||
let canPay = PKPaymentAuthorizationController.canMakePayments()
|
||||
print("💳 Can make payments: \(canPay)")
|
||||
|
||||
// 是否能使用指定卡网络支付
|
||||
let canPayWithNetworks = PKPaymentAuthorizationController.canMakePayments(
|
||||
usingNetworks: [.visa, .masterCard, .amex]
|
||||
)
|
||||
print("💳 Can pay with Visa/Master/Amex: \(canPayWithNetworks)")
|
||||
}
|
||||
func setupFileManager() {
|
||||
try? FileManager.default.createDirectory(at: FilePath.workingDirectory, withIntermediateDirectories: true)
|
||||
FileManager.default.changeCurrentDirectoryPath(FilePath.sharedDirectory.path)
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.in-app-payments</key>
|
||||
<array>
|
||||
<string>merchant.com.taw.hifastvpn</string>
|
||||
</array>
|
||||
<key>com.apple.developer.networking.networkextension</key>
|
||||
<array>
|
||||
<string>packet-tunnel-provider</string>
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.in-app-payments</key>
|
||||
<array>
|
||||
<string>merchant.com.taw.hifastvpn</string>
|
||||
</array>
|
||||
<key>com.apple.developer.networking.networkextension</key>
|
||||
<array>
|
||||
<string>packet-tunnel-provider</string>
|
||||
|
||||
Reference in New Issue
Block a user