Previously, when using AppDelegate, I was able to check the app’s launch options (launchOptions) to determine cases such as:
- Location updates (UIApplication.LaunchOptionsKey.location)
- Background push notifications (UIApplication.LaunchOptionsKey.remoteNotification)
However, after migrating to the SceneDelegate approach, launchOptions is no longer available — it always returns nil.
In my app, I need to branch the code depending on the launch options, but I can’t find a way to achieve this in the SceneDelegate environment.
👉 Is there a way to access launch options in SceneDelegate, similar to how it worked in AppDelegate? Or, if that’s no longer possible, what would be the proper alternative approach?
Any guidance would be greatly appreciated.
On apps that adopt a Scene Delegate, the App Delegate launchOptions will no longer be populated.
Instead apps can now check scene(_:willConnectTo:options:) which will populate UIScene.ConnectionOptions
Also do note that not every App Delegate launchOption
has an equivalent Scene Delegate connectionOption
For frameworks that also call a delegate function after the app is launched, the app is expected to use those callbacks as an indicator as to why the app has been launched in the background.
Argun Tekant / DTS Engineer / Core Technologies