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:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user