From eeaf0b0aef43e478b78a2b8c2d3b70ff2484bbfe Mon Sep 17 00:00:00 2001 From: Philipp Lepold Date: Tue, 22 Sep 2026 09:45:04 +0200 Subject: [PATCH] fix(ios): migrate to UIScene lifecycle --- open_wearable/analysis_options.yaml | 9 +++++ .../ios/Flutter/AppFrameworkInfo.plist | 2 -- open_wearable/ios/Podfile | 2 +- .../ios/Runner.xcodeproj/project.pbxproj | 17 ++++++---- open_wearable/ios/Runner/AppDelegate.swift | 22 +++++-------- open_wearable/ios/Runner/Info.plist | 33 +++++++++++++++---- 6 files changed, 56 insertions(+), 29 deletions(-) diff --git a/open_wearable/analysis_options.yaml b/open_wearable/analysis_options.yaml index d2f83007..b58a37db 100644 --- a/open_wearable/analysis_options.yaml +++ b/open_wearable/analysis_options.yaml @@ -1,3 +1,12 @@ +analyzer: + exclude: + - build/** + - android/** + - ios/** + - web/** + - windows/** + - macos/** + - linux/** include: package:flutter_lints/flutter.yaml linter: diff --git a/open_wearable/ios/Flutter/AppFrameworkInfo.plist b/open_wearable/ios/Flutter/AppFrameworkInfo.plist index 020f8c12..391a902b 100644 --- a/open_wearable/ios/Flutter/AppFrameworkInfo.plist +++ b/open_wearable/ios/Flutter/AppFrameworkInfo.plist @@ -10,8 +10,6 @@ io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 - MinimumOSVersion - 13.1 CFBundleName App CFBundlePackageType diff --git a/open_wearable/ios/Podfile b/open_wearable/ios/Podfile index 97e4628b..cd6131ea 100644 --- a/open_wearable/ios/Podfile +++ b/open_wearable/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -ios_deployment_target = '13.1' +ios_deployment_target = '15.0' platform :ios, ios_deployment_target # CocoaPods analytics sends network stats synchronously affecting flutter build latency. diff --git a/open_wearable/ios/Runner.xcodeproj/project.pbxproj b/open_wearable/ios/Runner.xcodeproj/project.pbxproj index 8f5fd5c4..bd242c4f 100644 --- a/open_wearable/ios/Runner.xcodeproj/project.pbxproj +++ b/open_wearable/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -464,7 +464,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -483,7 +483,7 @@ DEVELOPMENT_TEAM = 6DCQ69GP5G; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.1; + IPHONEOS_DEPLOYMENT_TARGET = 15; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -505,6 +505,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.kit.teco.openWearable.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -523,6 +524,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.kit.teco.openWearable.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -539,6 +541,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = edu.kit.teco.openWearable.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -596,7 +599,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -647,7 +650,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.1; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -668,7 +671,7 @@ DEVELOPMENT_TEAM = 6DCQ69GP5G; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.1; + IPHONEOS_DEPLOYMENT_TARGET = 15; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -693,7 +696,7 @@ DEVELOPMENT_TEAM = 6DCQ69GP5G; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.1; + IPHONEOS_DEPLOYMENT_TARGET = 15; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/open_wearable/ios/Runner/AppDelegate.swift b/open_wearable/ios/Runner/AppDelegate.swift index a7fc0a72..1e9a43ce 100644 --- a/open_wearable/ios/Runner/AppDelegate.swift +++ b/open_wearable/ios/Runner/AppDelegate.swift @@ -2,7 +2,7 @@ import Flutter import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { private var sensorShutdownBackgroundTask: UIBackgroundTaskIdentifier = .invalid private var lifecycleChannel: FlutterMethodChannel? @@ -27,15 +27,14 @@ import UIKit sensorShutdownBackgroundTask = .invalid } - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - let controller: FlutterViewController = window?.rootViewController as! FlutterViewController - let openFolderChannel = FlutterMethodChannel(name: "edu.teco.open_folder", binaryMessenger: controller.binaryMessenger) - let systemSettingsChannel = FlutterMethodChannel(name: "edu.kit.teco.openWearable/system_settings", binaryMessenger: controller.binaryMessenger) - lifecycleChannel = FlutterMethodChannel(name: "edu.kit.teco.openWearable/lifecycle", binaryMessenger: controller.binaryMessenger) - + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + + let messenger = engineBridge.applicationRegistrar.messenger() + let openFolderChannel = FlutterMethodChannel(name: "edu.teco.open_folder", binaryMessenger: messenger) + let systemSettingsChannel = FlutterMethodChannel(name: "edu.kit.teco.openWearable/system_settings", binaryMessenger: messenger) + lifecycleChannel = FlutterMethodChannel(name: "edu.kit.teco.openWearable/lifecycle", binaryMessenger: messenger) + openFolderChannel.setMethodCallHandler { (call: FlutterMethodCall, result: @escaping FlutterResult) in if call.method == "openFolder", let args = call.arguments as? [String: Any], let path = args["path"] as? String { guard let url = URL(string: path) else { @@ -88,8 +87,5 @@ import UIKit result(FlutterMethodNotImplemented) } } - - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } diff --git a/open_wearable/ios/Runner/Info.plist b/open_wearable/ios/Runner/Info.plist index 677c9991..d7778d73 100644 --- a/open_wearable/ios/Runner/Info.plist +++ b/open_wearable/ios/Runner/Info.plist @@ -39,20 +39,41 @@ This app uses Bluetooth to connect to wearable devices. NSBluetoothPeripheralUsageDescription This app requires Bluetooth access to communicate with wearable devices. - NSLocalNetworkUsageDescription - This app uses the local network to host a webserver for tools integration. - NSMotionUsageDescription - This app requires access to device motion in order to provide sensor data. - NSMicrophoneUsageDescription - This app records microphone audio with local sensor recording sessions. NSCameraUsageDescription Camera access may be required by an iOS file selection component used to import firmware files. The app does not use the camera as part of its normal workflow. + NSLocalNetworkUsageDescription + This app uses the local network to host a webserver for tools integration. NSLocationWhenInUseUsageDescription Location access may be required by an iOS file selection component used to import firmware files. The app does not use location as part of its normal workflow. + NSMicrophoneUsageDescription + This app records microphone audio with local sensor recording sessions. + NSMotionUsageDescription + This app requires access to device motion in order to provide sensor data. NSPhotoLibraryUsageDescription Needed for optional file selection functionality. UIApplicationSupportsIndirectInputEvents + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneDelegateClassName + FlutterSceneDelegate + UISceneConfigurationName + flutter + UISceneStoryboardFile + Main + + + + UIFileSharingEnabled UILaunchStoryboardName