From 527fd4b40a72bb17d66898586d30d8f1b43988e4 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Sat, 15 Aug 2026 14:35:38 -0700 Subject: [PATCH] feat(ios): adopt UIScene lifecycle for Flutter 3.47 Adopt UIApplicationSceneManifest and FlutterImplicitEngineDelegate in AppDelegate to support the UIScene lifecycle requirement on iOS. Co-authored-by: Cursor --- ios/Flutter/AppFrameworkInfo.plist | 2 -- ios/Podfile.lock | 6 +++--- .../xcshareddata/swiftpm/Package.resolved | 8 +++---- .../xcshareddata/swiftpm/Package.resolved | 8 +++---- ios/Runner/AppDelegate.swift | 14 ++++++++----- ios/Runner/Info.plist | 21 +++++++++++++++++++ 6 files changed, 41 insertions(+), 18 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 0d140800..391a902b 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 15.0 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6cba02bd..560b1f09 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -19,9 +19,9 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_secure_storage/ios" SPEC CHECKSUMS: - advanced_in_app_review: fe8fd50b8670cb3dbe67e4c26ca643f7aea8dbb8 - Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 + advanced_in_app_review: daebe4c801525b756fe589de60fd327cb12f965c + Flutter: 71a624a5bc0c04062bf19101d501e466baf2fb47 + flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13 PODFILE CHECKSUM: 57c8aed26fba39d3ec9424816221f294a07c58eb diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 38e2de1f..6839f6d5 100644 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk", "state" : { - "revision" : "8d5b4189f1f482df8d5c58c9985ea70491ef5382", - "version" : "12.14.0" + "revision" : "33a468adfdb75b53f05a37e7c886ca7c962b5c17", + "version" : "12.17.0" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "219e564a8510e983e675c94f77f7f7c50049f22d", - "version" : "12.14.0" + "revision" : "fceaffa07d22dcd5624d3639fd970351a4a5ad8c", + "version" : "12.17.0" } }, { diff --git a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved index 38e2de1f..6839f6d5 100644 --- a/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk", "state" : { - "revision" : "8d5b4189f1f482df8d5c58c9985ea70491ef5382", - "version" : "12.14.0" + "revision" : "33a468adfdb75b53f05a37e7c886ca7c962b5c17", + "version" : "12.17.0" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "219e564a8510e983e675c94f77f7f7c50049f22d", - "version" : "12.14.0" + "revision" : "fceaffa07d22dcd5624d3639fd970351a4a5ad8c", + "version" : "12.17.0" } }, { diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index a66ef771..a51f2738 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -2,19 +2,23 @@ import Flutter import UIKit @main -@objc class AppDelegate: FlutterAppDelegate { +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - guard let cookieExtractorRegistrar = self.registrar( + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + guard let cookieExtractorRegistrar = engineBridge.pluginRegistry.registrar( forPlugin: "CookieExtractorPlugin" ) else { assertionFailure("Failed to create CookieExtractorPlugin registrar") - return false + return } CookieExtractorPlugin.register(with: cookieExtractorRegistrar) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 6052fdf9..1f85dcd5 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -52,6 +52,27 @@ UIApplicationSupportsIndirectInputEvents + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneDelegateClassName + FlutterSceneDelegate + UISceneConfigurationName + flutter + UISceneStoryboardFile + Main + + + + UIStatusBarHidden UIBackgroundModes