iOS intermittently fails to send URLs via UISceneDelegate

I'm observing a sporadic bug in our web client where incoming URLs (triggered by a Push Notification or link tapped in another app) do not trigger either of the two expected API callbacks noted in the developer documentation for UISceneDelegate.

Specifically, Apple's docs say:

If your app has opted into Scenes, and your app isn’t running, the system delivers the URL to the scene(_:willConnectTo:options:) delegate method after launch, and to scene(_:openURLContexts:) when your app opens a URL while running or suspended in memory.

Our client app has opted into scenes and the two callbacks mentioned above work reliably most of the time for incoming URLs. However, using the exact same test links or push notifications, I'm able to reproduce intermittent issues where I can see that neither of the above callbacks are triggered when the app is foregrounded to handle a URL.

The bug seems to occur when:

  1. The app has been previously launched, and is backgrounded
  2. It's left in the background for some time (system memory pressure, from using other apps etc., might possibly play a factor also)

In this scenario, sometimes when either an external link or URL via push notification is opened, I can see that neither of the two iOS delegate methods for UISceneDelegate are called. Our app is brought to the foreground correctly as though the URL will be handled, but the URL/link is not processed since it is never sent to our client.

A few other notes:

  • When the bug is repro'd using push notifications, I can see that our app receives a callback to userNotificationCenter:didReceive:, so the push notification definitely arrives. However, as noted above, the normal 2 API callbacks for UISceneDelegate are never triggered, and since those two callsites are where we handle incoming URLs, the URL from the push notification is never opened
  • I haven't been able to observe any code in our app that precedes these hooks in our scene delegate that could be interfering. (As mentioned above, the same steps to replicate work the majority of the time)

Does anyone know whether this could be a possible iOS bug?

Any help/suggestions are greatly appreciated. Thank you

iOS intermittently fails to send URLs via UISceneDelegate
 
 
Q