Correct initialisation of UIKit scene and fix for forced compatibility mode

This commit is contained in:
Olof Hedman
2025-09-17 14:22:52 +02:00
parent 9e367105bb
commit 14e94bfc8e
6 changed files with 123 additions and 13 deletions

View File

@@ -435,7 +435,7 @@
FRAMEWORK_SEARCH_PATHS = "";
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = Klottr/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = NO;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
@@ -466,7 +466,7 @@
FRAMEWORK_SEARCH_PATHS = "";
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = Klottr/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = NO;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";

View File

@@ -17,14 +17,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
PlatformAuthStorage.shared.install(delegate: KeychainStorage())
PlatformAuthStorage.shared.install(delegate: KeychainStorage())
return true
}
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = MainKt.MainViewController() // adjust pkg
window?.makeKeyAndVisible()
return true
}
func application(_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {

View File

@@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,5 +1,5 @@
//
// GoogleAuthError.swift
// GoogleAutIOS.swift
// Klottr
//
// Created by Olof Hedman on 2025-09-10.

View File

@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -15,18 +17,53 @@
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>YOUR_REVERSED_IOS_CLIENT_ID</string>
<string>com.googleusercontent.apps.508890452239-66lqrsbphlmqltb6aoe3c0d6dlgtjse8</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>UILaunchScreen</key>
<dict>
<!-- Optional image in your asset catalog -->
<!-- <key>UIImageName</key><string>LaunchScreenLogo</string> -->
<!-- Solid background from a Color Set named LaunchScreenBackground -->
<key>UIColorName</key><string>LaunchScreenBackground</string>
<!-- Safe default -->
<key>UIImageRespectsSafeAreaInsets</key><true/>
</dict>
<key>GIDClientID</key>
<string>508890452239-66lqrsbphlmqltb6aoe3c0d6dlgtjse8.apps.googleusercontent.com</string>
<key>GIDServerClientID</key>
<string>508890452239-5hdoedc9b4rk3k5mmru176lj7f04135r.apps.googleusercontent.com</string>
<key>CADisableMinimumFrameDurationOnPhone</key><true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,38 @@
//
// SceneDelegate.swift
// Klottr
//
// Created by Olof Hedman on 2025-09-17.
//
import UIKit
import shared
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
let root = MainKt.MainViewController() // Compose VC
let window = UIWindow(windowScene: windowScene)
window.rootViewController = root
self.window = window
window.makeKeyAndVisible()
// If you need to kick off sign-in at launch, do it here:
DispatchQueue.main.async {
Task {
do {
try await GoogleAuthIOS.signIn(presenting: root)
} catch {
NSLog("Sign In Error: \(error)")
}
}
}
}
}