Scene-based Launch Detection

Our app supports UIScene. As a result, launchOptions in application(_:didFinishLaunchingWithOptions:) is always nil.

However, the documentation mentions that UIApplication.LaunchOptionsKey.location should be present when the app is launched due to a location event.

Given that our app is scene-based:

How can we reliably determine whether the app was launched due to a location update, geofence, or significant location change?

Is there a recommended pattern or API to detect this scenario in a Scene-based app lifecycle?

This information is critical for us to correctly initialize location-related logic on launch.

Relevant documentation: https://developer.apple.com/documentation/corelocation/cllocationmanager/startmonitoringsignificantlocationchanges()

For apps that support UIScene, the UIApplication launch options will be nil.

Instead the app will be presented with the UIScene.ConnectionOptions.

Not every launch option will have an equivalent connection option.

Specifically for CoreLocation triggered app launches, as after launch there will always be a delegate method that will be called to pass on the information, you can use that as an indicator that your app was launched by CoreLocation and based on the specific method that was called back, you can determine which API has triggered it.

Could you please clarify which specific callback(s) we should rely on as the indicator? We want to make sure we’re detecting the launch source correctly and aligning with the intended behavior.

Scene-based Launch Detection
 
 
Q