From f5715987fc42f1d824d2b3e28406fdbe1441fc1f Mon Sep 17 00:00:00 2001
From: edde746 <86283021+edde746@users.noreply.github.com>
Date: Sun, 1 Mar 2026 15:06:45 +0100
Subject: [PATCH] feat: migrate iOS to scene lifecycle
---
ios/Runner/AppDelegate.swift | 18 ++++++++++--------
ios/Runner/Info.plist | 21 +++++++++++++++++++++
2 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift
index 432d1012..0fe76503 100644
--- a/ios/Runner/AppDelegate.swift
+++ b/ios/Runner/AppDelegate.swift
@@ -3,18 +3,11 @@ import UIKit
import AVFoundation
@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)
-
- // Register MPV player plugin
- if let registrar = self.registrar(forPlugin: "MpvPlayerPlugin") {
- MpvPlayerPlugin.register(with: registrar)
- }
-
// Configure audio session for media playback
do {
let session = AVAudioSession.sharedInstance()
@@ -28,4 +21,13 @@ import AVFoundation
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
+
+ func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
+ GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
+
+ // Register MPV player plugin
+ if let registrar = engineBridge.pluginRegistry.registrar(forPlugin: "MpvPlayerPlugin") {
+ MpvPlayerPlugin.register(with: registrar)
+ }
+ }
}
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 1a4bbea0..dfe4135b 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -66,5 +66,26 @@
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
+ UIApplicationSceneManifest
+
+ UIApplicationSupportsMultipleScenes
+
+ UISceneConfigurations
+
+ UIWindowSceneSessionRoleApplication
+
+
+ UISceneClassName
+ UIWindowScene
+ UISceneDelegateClassName
+ FlutterSceneDelegate
+ UISceneConfigurationName
+ flutter
+ UISceneStoryboardFile
+ Main
+
+
+
+