Skip to content

fix(ios): deliver launch urls, activities and quick actions to scene apps - #11518

Merged
NathanWalker merged 1 commit into
mainfrom
fix/ios-scene-launch-payloads
Oct 12, 2026
Merged

NathanWalker merged 1 commit into
mainfrom
fix/ios-scene-launch-payloads

Conversation

@edusperoni

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

Once an app declares UIApplicationSceneManifest, UIKit stops calling application:openURL:options:, application:continueUserActivity:restorationHandler: and application:performActionForShortcutItem:completionHandler:. The scene delegate bridge covers the warm case by forwarding scene:openURLContexts:, scene:continueUserActivity: and windowScene:performActionForShortcutItem:completionHandler: to those handlers.

When one of these payloads is what launches the app, UIKit delivers it only in scene:willConnectToSession:options:, as connectionOptions.URLContexts, connectionOptions.userActivities or connectionOptions.shortcutItem, and never calls the warm scene callbacks for it. sceneWillConnectToSessionOptions doesn't look at any of them (apart from reading openWindow() data off the first activity), so:

  • opening a document from Files / the share sheet, or tapping a custom-scheme or universal link while the app is not running, is dropped
  • Handoff / Spotlight continuations that cold-launch the app are dropped
  • launching the app from a Home Screen quick action does nothing

There is no sceneOpenURLContexts / sceneContinueUserActivity / scenePerformActionForShortcutItem event, and no call into handlers registered with Application.ios.addDelegateHandler(). The same payloads work when the app is already running, which makes this easy to miss in development.

What is the new behavior?

sceneWillConnectToSessionOptions delivers the launch payloads through the same path as the warm callbacks: it emits the scene event on the window and on Application.ios, then forwards to the legacy delegate handler.

  • Delivery happens after the window content is resolved, keeping the pre-scene order where openURL and friends arrived after launch had finished and the root view existed.
  • The activity openWindow() attaches to carry window data (<bundleId>.scene) is not forwarded as a continuation (new getLaunchUserActivities helper in scene-delegate-bridge.ts).
  • A cold-launch quick action has no completion handler to report to, so oneShotCompletion now accepts undefined.
  • The three warm callbacks and the cold-launch path share one helper per payload type, so their events and forwarding can't drift apart.

UIKit sends a given payload either at connect or through the warm callback, never both, so this doesn't double-deliver.

Tests cover the activity filtering and the completion-less oneShotCompletion. The scene delegate itself isn't unit-testable without UIKit, so the cold-launch path was checked by reading the code against the warm callbacks and has not yet been run on a device.

…apps

With a scene manifest, UIKit hands the payloads that launch the app only to
scene:willConnectToSession:options: (connectionOptions.URLContexts,
userActivities and shortcutItem). scene:openURLContexts:,
scene:continueUserActivity: and windowScene:performActionForShortcutItem:
fire only once the scene is connected, so opening a file or link while the
app was not running, or launching it from a quick action, was dropped: no
scene event, and no call into handlers registered with addDelegateHandler.

The connecting scene now delivers those payloads through the same path as
the warm callbacks, after its content is resolved. The activity openWindow()
uses to carry window data is not forwarded as a continuation.
@nx-cloud

nx-cloud Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9541233

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 24s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-11 21:35:18 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11518
npm i https://pkg.pr.new/@nativescript/vite@11518
npm i https://pkg.pr.new/@nativescript/webpack@11518

commit: 9541233

@NathanWalker
NathanWalker merged commit 92c4f40 into main Oct 12, 2026
10 checks passed
@NathanWalker
NathanWalker deleted the fix/ios-scene-launch-payloads branch October 12, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants