30 lines
968 B
Swift
30 lines
968 B
Swift
import UIKit
|
|
|
|
@MainActor
|
|
final class MobileAppDelegate: NSObject, UIApplicationDelegate {
|
|
func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
) -> Bool {
|
|
if ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil {
|
|
application.registerForRemoteNotifications()
|
|
}
|
|
return true
|
|
}
|
|
|
|
func application(
|
|
_ application: UIApplication,
|
|
configurationForConnecting connectingSceneSession: UISceneSession,
|
|
options: UIScene.ConnectionOptions
|
|
) -> UISceneConfiguration {
|
|
let configuration = UISceneConfiguration(
|
|
name: nil,
|
|
sessionRole: connectingSceneSession.role
|
|
)
|
|
if connectingSceneSession.role == .windowApplication {
|
|
configuration.delegateClass = MobileSceneDelegate.self
|
|
}
|
|
return configuration
|
|
}
|
|
}
|