From 910bda8cc12e6351a15f304dbf5b0b07fee5343e Mon Sep 17 00:00:00 2001 From: nyne Date: Sun, 27 Oct 2024 16:31:01 +0800 Subject: [PATCH] fix ios --- ios/Podfile | 2 +- ios/Runner/AppDelegate.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/Podfile b/ios/Podfile index 8eaa995..3da15a0 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.0' +platform :ios, '14.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index d236fa2..aa84a21 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -13,6 +13,10 @@ import UniformTypeIdentifiers ) -> Bool { GeneratedPluginRegistrant.register(with: self) + guard let controller = window?.rootViewController as? FlutterViewController else { + fatalError("rootViewController is not of type FlutterViewController") + } + let methodChannel = FlutterMethodChannel(name: "venera/method_channel", binaryMessenger: controller.binaryMessenger) methodChannel.setMethodCallHandler { (call, result) in if call.method == "getProxy" {