Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][locker] Fix iOS 27 startup (#14210)

aman-pilot80e52508fa76
diff --git a/mobile/apps/locker/changes/ios-startup.md b/mobile/apps/locker/changes/ios-startup.md
new file mode 100644
index 0000000000..69b2e6d94f
--- /dev/null
+++ b/mobile/apps/locker/changes/ios-startup.md
@@ -0,0 +1 @@
+- Fixed an app launch failure on iOS 27.
diff --git a/mobile/apps/locker/ios/Runner/AppDelegate.swift b/mobile/apps/locker/ios/Runner/AppDelegate.swift
index 626664468b..f3b72a5282 100644
--- a/mobile/apps/locker/ios/Runner/AppDelegate.swift
+++ b/mobile/apps/locker/ios/Runner/AppDelegate.swift
@@ -1,13 +1,37 @@
import Flutter
import UIKit
+import app_links
@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)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
+
+ func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
+ GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
+ }
+}
+
+class SceneDelegate: FlutterSceneDelegate {
+ override func scene(
+ _ scene: UIScene,
+ willConnectTo session: UISceneSession,
+ options connectionOptions: UIScene.ConnectionOptions
+ ) {
+ // AppLinks 6.4.1 does not read cold-start scene connection options.
+ for context in connectionOptions.urlContexts {
+ AppLinks.shared.handleLink(url: context.url)
+ }
+ for activity in connectionOptions.userActivities {
+ if let url = activity.webpageURL {
+ AppLinks.shared.handleLink(url: url)
+ }
+ }
+ super.scene(scene, willConnectTo: session, options: connectionOptions)
+ }
+
}
diff --git a/mobile/apps/locker/ios/Runner/Info.plist b/mobile/apps/locker/ios/Runner/Info.plist
index d34e9ccca1..f63400c38b 100644
--- a/mobile/apps/locker/ios/Runner/Info.plist
+++ b/mobile/apps/locker/ios/Runner/Info.plist
@@ -24,6 +24,29 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>FlutterDeepLinkingEnabled</key>
+ <false/>
+ <key>UIApplicationSceneManifest</key>
+ <dict>
+ <key>UIApplicationSupportsMultipleScenes</key>
+ <false/>
+ <key>UISceneConfigurations</key>
+ <dict>
+ <key>UIWindowSceneSessionRoleApplication</key>
+ <array>
+ <dict>
+ <key>UISceneClassName</key>
+ <string>UIWindowScene</string>
+ <key>UISceneConfigurationName</key>
+ <string>flutter</string>
+ <key>UISceneDelegateClassName</key>
+ <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
+ <key>UISceneStoryboardFile</key>
+ <string>Main</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>