fix(ios): remove SceneDelegate, use AppDelegate window instead

Simplified app initialization:

Removed SceneDelegate:
- Removed SceneDelegate configuration from Info.plist
- SceneDelegate class wasn't being found by iOS runtime
- Using traditional AppDelegate window approach instead

AppDelegate Window Setup:
- Create window in didFinishLaunchingWithOptions
- Instantiate ViewController directly
- Set as rootViewController and make key and visible
- Added logging to track initialization

Fixes:
- Black screen: AppDelegate now creates window and ViewController
- SceneDelegate error: removed problematic SceneDelegate configuration
- WebView initialization: ViewController should now be created correctly

Result: App should now initialize properly with ViewController and WebView
This commit is contained in:
Matthew Raymer
2025-11-11 21:21:34 -08:00
parent 517fe15d4d
commit 3250b3fc33
2 changed files with 17 additions and 22 deletions

View File

@@ -26,11 +26,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
// Initialize Daily Notification Plugin demo fetcher // Initialize Daily Notification Plugin demo app
// Note: This is called before Capacitor bridge is initialized
// Plugin registration happens in ViewController
print("AppDelegate: Initializing Daily Notification Plugin demo app") print("AppDelegate: Initializing Daily Notification Plugin demo app")
NSLog("AppDelegate: Initializing Daily Notification Plugin demo app")
// Create window and view controller (traditional iOS approach)
let window = UIWindow(frame: UIScreen.main.bounds)
self.window = window
print("AppDelegate: Creating ViewController")
NSLog("AppDelegate: Creating ViewController")
let viewController = ViewController()
window.rootViewController = viewController
window.makeKeyAndVisible()
print("AppDelegate: Window made key and visible")
NSLog("AppDelegate: Window made key and visible")
return true return true
} }

View File

@@ -96,24 +96,7 @@
</dict> </dict>
</dict> </dict>
<!-- Scene Configuration (iOS 13+) --> <!-- Scene Configuration removed - using AppDelegate window instead -->
<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>SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
<!-- Background App Refresh --> <!-- Background App Refresh -->
<key>UIApplicationExitsOnSuspend</key> <key>UIApplicationExitsOnSuspend</key>