Skip to content

fix(mobile): launch on iOS 27 by adopting the scene lifecycle - #22515

Open
b1nhm1nh wants to merge 5 commits into
stablyai:mainfrom
b1nhm1nh:fix/ios-scene-lifecycle
Open

b1nhm1nh wants to merge 5 commits into
stablyai:mainfrom
b1nhm1nh:fix/ios-scene-lifecycle

Conversation

@b1nhm1nh

@b1nhm1nh b1nhm1nh commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The iPhone app crashed the moment it opened when built with the newest Xcode (27). Apple now requires apps to use a newer startup style ("scenes"); our app still used the old one. This adds a small build plugin that switches the app to the new style, and bumps the minimum iOS version so the newest Xcode can compile our dependencies.

What Changed

Before: building mobile/ with Xcode 27 (iOS 27 SDK):

  1. The build failed: Xcode 27 rejects pods targeting below iOS 15, and at the generated 15.1 target expo-router does not compile (LinkPreviewNativeActionView.swift:141: 'subtitle' is only available in iOS 16.0 or newer).
  2. With that worked around, the app crashed on launch before any JS ran — EXC_BREAKPOINT in UIKit's _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption_block_invoke, raised from -[UIApplication workspace:didCreateScene:…].

After: the app builds with Xcode 27 and launches and stays running on the iOS 27 simulator.

Mechanism:

  • New config plugin mobile/plugins/ios-scene-lifecycle.js, registered in app.json, applied at prebuild:
    • Info.plist: adds a single-scene UIApplicationSceneManifest pointing at $(PRODUCT_MODULE_NAME).SceneDelegate.
    • AppDelegate.swift: removes the template's UIWindow(frame:) + startReactNative block from didFinishLaunching (the factory is still created there) and appends a SceneDelegate that creates the window from the UIWindowScene and starts React Native in it.
    • Links: under scenes UIKit delivers URLs to the scene, not the app delegate. For a cold-start URL or user activity, the scene delegate puts it in React Native's launch options and also calls the app delegate's open: / continue:, so React Native's initial URL and expo-linking's initial URL agree. It forwards warm openURLContexts (every URL in the batch) and continue userActivity to the same app-delegate handlers. That keeps orca://pair?… and universal links going through RCTLinkingManager and Expo's subscribers unchanged.
    • Lifecycle: once a scene manifest exists, UIKit stops sending the app delegate its active, inactive, foreground and background callbacks. The scene delegate forwards all four, as Expo's own ExpoAppSceneDelegate does, so Expo's app-delegate subscribers still hear them.
    • Idempotent across repeated prebuilds, and it throws if Expo's template no longer matches, rather than silently producing an app that crashes.
  • expo-build-properties → ios.deploymentTarget: "16.0". The two local module podspecs (OrcaMobileWebShell, OrcaNotificationDismissal) and one code comment are raised from 15.1 to 16.0 to match.
  • New config plugin mobile/plugins/ios-pod-deployment-target.js: ios.deploymentTarget alone only moves the app and the Podfile platform; each pod keeps its podspec minimum (SDWebImage 9.0, RNSVG 12.4, RNCAsyncStorage 13.4, React Native 15.1). The plugin appends a post_install step after react_native_post_install that raises — never lowers — every pod build configuration to the app's target, and throws if the Podfile template stops matching.

Why

  • Apple has flagged the non-scene lifecycle as deprecated since iOS 26; iOS 27 turns it into a launch-time trap for apps linked against the iOS 27 SDK. Every Xcode 27 build of Orca is affected, independent of any feature work.
  • A config plugin, not a checked-in ios/ folder: mobile/ios is generated and gitignored; the repo already customizes native output through plugins/ (e.g. android-respect-rotation-lock.js).
  • Expo SDK 55's ExpoAppDelegate has no scene support yet (// TODO: - Configuring and Discarding Scenes), so there is no upstream flag to flip. When Expo ships scene support in its template, the plugin's template check will fail loudly and it can be removed.
  • iOS 16.0 is the lowest target that compiles expo-router as shipped; iOS 15 is well outside current support, and Xcode 27's own floor is 15.0.

Linked Issue

No existing issue — found while building the mobile app with Xcode 27.

Visual Proof

N/A for UI: nothing on screen changes. Evidence is launch behavior — before: crash report EXC_BREAKPOINT in _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption; after: process alive after launch on iPhone 18 Pro simulator (iOS 27.0), no new crash report.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • From a clean expo prebuild --platform ios --clean (no hand edits): all 308 pod build configurations land on 16.0 and the scene delegate is generated.

  • macOS 26.6.2, Xcode 27.0, iOS 27.0 simulator: Release simulator build ** BUILD SUCCEEDED **; install + launch; process still running 20s later; no new DiagnosticReports entry. Before the change the same build crashed at launch every time.

  • Both plugins verified against Expo SDK 55's actual template (expo/template.tgz → ios/HelloWorld/AppDelegate.swift and ios/Podfile): window block removed, second application is a no-op.

  • New mobile/scripts/ios-scene-lifecycle-plugin.test.ts (7 tests) and ios-pod-deployment-target-plugin.test.ts (6 tests). They cover the rewrite and hook placement, raise-only, idempotency, and a loud failure on template drift. They also run each plugin's registered infoPlist / appDelegate / podfile mod and check the app.json entries, so removing any of that wiring fails the suite. Lint/format and the changed-code quality gate pass.

  • Cold start: terminated the app, then xcrun simctl openurl … 'orca://pair?code=…' launched it straight into the pairing screen (it rejected the dummy code as expected).

  • Warm link: simctl openurl on the running app shows iOS's "Open in Orca?" prompt and routes to pairing.

  • Background/foreground: switched to Settings and back. The app kept the same process, and UIKit logged UIApplicationWillEnterForegroundNotification and then applicationDidBecomeActive.

  • Not yet verified: a physical device, and a fresh iOS build after the last commit, which only raises the two local podspec minimums to the app's 16.0 target (the plugin tests pass).

  • Android: unaffected (iOS-only plugin and property).

AI Disclosure

Implemented with Claude Code (Claude Opus 5.5), reviewed and tested by the author.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Minimum iOS rises from 15.1 to 16.0. iPhones that cannot run iOS 16 (iPhone 6s/7/SE 1st gen) would stop receiving updates. Flagging for a maintainer decision.
  • UIApplicationSupportsMultipleScenes is false: behavior stays single-window; iPad multi-window is out of scope.
  • No SSH, desktop, or wire-protocol impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — the mobile plugin tests, lint/format and the changed-code quality gate pass locally; the full desktop suite and build are left to CI because this change touches only mobile/.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ac4b4690-77a1-47ff-93ff-add20df8c552

📥 Commits

Reviewing files that changed from the base of the PR and between c12fa53 and 3a58d7d.

📒 Files selected for processing (2)
  • mobile/plugins/ios-scene-lifecycle.js
  • mobile/scripts/ios-scene-lifecycle-plugin.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The mobile app configuration registers plugins for iOS scene lifecycle handling and pod deployment target updates. It sets the iOS deployment target to 16.0. The scene lifecycle plugin adds a scene manifest and updates AppDelegate.swift to use a SceneDelegate. The scene delegate creates the window and forwards URL and user activity events to the app delegate. The pod plugin updates lower or unset pod deployment targets. The iOS podspec minimum versions also change to 16.0. Tests cover both plugins’ transformations and error cases.

Priority: ⬆️ High

Merge Risk: ⚪ Minimal · up to 3a58d

No actionable merge-blocking issue is established. The iOS 16 minimum still requires the stated maintainer decision.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 3a58d

The new startup path warrants review because it handles links from outside the app. The existing pairing confirmation remains in place, and no new security bypass was established. Cold-start link delivery and scene recovery still need validation.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — External links and user activities reach the mobile app's native lifecycle adapter and existing link handlers. The evidenced downstream pairing path is confined to on-device navigation until a user confirms pairing; no new service or data-store authority is shown.

Security Findings and Attack Paths

  • inferred — No bypass of pairing confirmation is established: the generated adapter delegates link handling, while the existing route parses the URL and requires a Pair action before starting an attempt. Native handling and event deduplication remain unverified.

Trust Boundaries and Controls

  • observed — The JavaScript route accepts a pairing code only from a matching scheme, host and path; the confirmation screen resolves an offer and requires an explicit user action. These controls do not establish what checks, if any, the generated native AppDelegate performs with URL options.

Resilience and Maintainability Implications

  • inferred — Cold launch supplies a URL through both launch options and an AppDelegate callback, while the app independently reads its initial URL and listens for URL events. The available source does not establish delivery order or whether native linking deduplicates those paths; repeated scene-start recovery is likewise unverified.

Hardening Proposals

  • proposed — Validate cold-link delivery and sender attribution against the generated native handlers, including simultaneous URL and activity inputs, before relying on a single-delivery or provenance guarantee.
  • proposed — Exercise scene reconnection and interrupted startup in a generated iOS build to establish window ownership and React Native startup behavior across recovery.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers the required explanation, changes, rationale, testing, impact, and checklist items. However, the required Linked Issue section is incomplete because it states that no issue exis… Add a valid linked issue reference in the Linked Issue section, using the required Fixes #<issue-number> format, or create an issue before merging.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the mobile iOS 27 launch fix and the main implementation approach: adopting the scene lifecycle.
Full details: Description check

Explanation

The description covers the required explanation, changes, rationale, testing, impact, and checklist items. However, the required Linked Issue section is incomplete because it states that no issue exists and leaves Fixes # empty.

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the iOS 27 launch fix works, with two latent scene-lifecycle gaps and a couple of test/doc nits worth a look.

Reviewed changes — one commit (bf0e0d6), 3 files, entire diff read.

  • mobile/plugins/ios-scene-lifecycle.js (new): Expo config plugin that writes a single-scene UIApplicationSceneManifest, strips React Native's window/startReactNative block from the generated AppDelegate.swift, and appends a SceneDelegate that builds the window from the UIWindowScene, starts RN with the cold-start URL as a launch option, and forwards warm URLs/NSUserActivity to the app delegate.
  • mobile/app.json: registers the plugin, bumps expo-build-properties ios.deploymentTarget to 16.0.
  • mobile/scripts/ios-scene-lifecycle-plugin.test.ts (new): tests for the rewrite, idempotency, and loud template-drift failure.

The core mechanism checks out. I verified the WINDOW_BLOCK regex matches Expo SDK 55's real AppDelegate.swift template, the emitted Swift type-checks against the RN 0.83 / Expo SDK 55 APIs, and a cold-start orca:// link reaches React Native's Linking.getInitialURL() through the bridge launch options — which is exactly what mobile/app/_layout.tsx and mobile/app/pair.tsx read, so pairing on cold start is preserved.

ℹ️ Deployment target 16.0 raises the app's floor

This is the right call to compile expo-router under Xcode 27, but it drops the iPhone 6s / 7 / SE 1st gen from future builds. As noted in the PR body, that is a product decision for a maintainer rather than a code defect. Two local podspecs still declare :ios => '15.1' and mobile/modules/orca-mobile-web-shell/ios/MobileWebShellView.swift:206 still cites a 15.1 floor; harmless, but worth tidying for consistency.

Technical details
# iOS floor and leftover 15.1 references

## Affected sites
- `mobile/app.json:112` — `deploymentTarget` 15.1 → 16.0
- `mobile/modules/orca-mobile-web-shell/ios/OrcaMobileWebShell.podspec:10` — `:ios => '15.1'`
- `mobile/modules/orca-notification-dismissal/ios/OrcaNotificationDismissal.podspec:10` — `:ios => '15.1'`
- `mobile/modules/orca-mobile-web-shell/ios/MobileWebShellView.swift:206` — comment cites the 15.1 floor

## Required outcome
- Confirm dropping pre-iOS-16 devices is intended.
- Decide whether the local podspec platforms / comment should follow the app floor (cosmetic; 15.1 pods still build and link into a 16.0 app).

## Open questions for the human (optional)
- Is raising the minimum to 16.0 approved, or should this ship as 15.1 plus an iOS-16-only pod workaround?

ℹ️ Nitpicks

  • The test's TEMPLATE constant is a hand-written paraphrase of Expo SDK 55's real AppDelegate.swift (it omits the // Linking API and // Universal Links overrides and public on the class). The regex only depends on the window block, so the transform is still pinned — but a fixture that does not track the real template cannot detect drift in the parts it omits.
  • UIApplication.LaunchOptionsKey.url is used for the cold-start URL; Expo's current canonical scene delegate builds the same key via UIApplication.LaunchOptionsKey(rawValue: "UIApplicationLaunchOptionsURLKey"). Same key, so no functional difference — only relevant if a future SDK deprecates the .url accessor.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread mobile/plugins/ios-scene-lifecycle.js Resolved
Comment thread mobile/plugins/ios-scene-lifecycle.js Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the pod deployment-target plugin checks out; one minor test-coverage suggestion inline.

Reviewed changes — one new commit (7596304) on top of bf0e0d6. Net additions: a new iOS config plugin, its test, and one app.json entry.

  • mobile/plugins/ios-pod-deployment-target.js (new): appends a post_install step after react_native_post_install(...) that raises every pod target's IPHONEOS_DEPLOYMENT_TARGET — never lowers it — to podfile_properties['ios.deploymentTarget'], throwing if the Podfile template stops matching.
  • mobile/app.json: registers the new plugin; keeps expo-build-properties ios.deploymentTarget at "16.0".
  • mobile/scripts/ios-pod-deployment-target-plugin.test.ts (new): tests hook placement, raise-only, idempotency, and loud template-drift failure.

I re-ran the transform against Expo SDK 55's real ios/Podfile: POST_INSTALL_CALL matches, the hook lands at the correct indentation inside post_install directly after the React Native call, and a second pass is a no-op; ruby -c parses the result. podfile_properties is a top-level local the template already reads in that same block, and expo-build-properties writes the ios.deploymentTarget key the hook reads. CocoaPods runs the Podfile post_install hook before saving the Pods project, so the mutation persists, and RN's own updateOSDeploymentTarget only raises pods to RN's floor (15.1) — this plugin is what lifts them to the 16.0 that expo-router needs. The prior review's three open threads are on the untouched ios-scene-lifecycle.js plugin and its test, so they are unchanged by this commit and not re-raised.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — one commit (1f9ef2a) on top of the reviewed 7596304: the SceneDelegate in mobile/plugins/ios-scene-lifecycle.js and the two plugin test files.

  • Cold-start links now reach the app delegate. willConnectTo maps connectionOptions.userActivities.first into React Native's launch options and, after startReactNative, forwards the launch URL and activity through the app delegate's open: / continue:, so expo-linking's registry (ExpoLinkingRegistry.initialURL) is populated alongside RN's Linking.getInitialURL().
  • Scene lifecycle transitions are forwarded. sceneDidBecomeActive / sceneWillResignActive / sceneWillEnterForeground / sceneDidEnterBackground now call the app delegate equivalents, which ExpoAppDelegate fans out to Expo subscribers, restoring the foreground/background callbacks UIKit stops sending to the app delegate once a scene manifest exists.
  • Tests cover the wiring. Added assertions for the generated lifecycle forwards and for both the ios.infoPlist and ios.appDelegate mods; the pod plugin test now exercises the registered ios.podfile mod and the app.json plugin list / deploymentTarget.

I checked the new Swift against the SDK 55 sources: ExpoAppDelegate implements all four lifecycle methods, LinkingAppDelegateSubscriber implements open: / continue: and sets the registry, and RCTLinkingManager.getInitialURL reads exactly the launch-option keys the plugin now writes. RCTLinkingManager short-circuits its app-delegate paths for scene-based apps, so the added forward does not double-post RN's url event. All four prior threads are addressed.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@b1nhm1nh

Copy link
Copy Markdown
Contributor Author

Follow-up to the first Pullfrog review: c12fa53 raises the two local module podspecs (OrcaMobileWebShell, OrcaNotificationDismissal) and the MobileWebShellView.swift comment from 15.1 to 16.0 to match the app floor. The iOS plugin tests still pass (12/12). Raising the minimum iOS version to 16.0 is still flagged for a maintainer decision in Notes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Forward every delivered URL context. · ios-scene-lifecycle.js:36-55

mobile/plugins/ios-scene-lifecycle.js:36-55
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Forward every delivered URL context.

When UIKit supplies more than one URL context, .first drops every later URL. If a later context contains an orca://pair link, Expo Linking never receives it, so the app does not open that pairing confirmation. Keep the first URL in launchOptions, but forward every URL context. Apply the same change to scene(_:openURLContexts:), which also currently keeps only the first URL.

Suggested fix
-    let url = connectionOptions.urlContexts.first?.url
+    let urls = connectionOptions.urlContexts.map(\.url)
+    let url = urls.first
...
-    if let url {
+    for url in urls {
       _ = appDelegate.application(UIApplication.shared, open: url, options: [:])
     }
...
-    guard let context = URLContexts.first else {
-      return
-    }
-    var options: [UIApplication.OpenURLOptionsKey: Any] = [:]
-    if let source = context.options.sourceApplication {
-      options[.sourceApplication] = source
-    }
-    _ = UIApplication.shared.delegate?.application?(
-      UIApplication.shared, open: context.url, options: options)
+    for context in URLContexts {
+      var options: [UIApplication.OpenURLOptionsKey: Any] = [:]
+      if let source = context.options.sourceApplication {
+        options[.sourceApplication] = source
+      }
+      _ = UIApplication.shared.delegate?.application?(
+        UIApplication.shared, open: context.url, options: options)
+    }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 860df038-9297-48db-b4ee-9f99c465fa0c

📥 Commits

Reviewing files that changed from the base of the PR and between 1f9ef2a and c12fa53.

📒 Files selected for processing (3)
  • mobile/modules/orca-mobile-web-shell/ios/MobileWebShellView.swift
  • mobile/modules/orca-mobile-web-shell/ios/OrcaMobileWebShell.podspec
  • mobile/modules/orca-notification-dismissal/ios/OrcaNotificationDismissal.podspec

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@b1nhm1nh

Copy link
Copy Markdown
Contributor Author

@coderabbitai re "Forward every delivered URL context": fixed in 3a58d7d. scene(_:openURLContexts:) now forwards each URL context to the app delegate, and a test asserts it no longer reads only URLContexts.first.

Cold start still forwards only the first URL, on purpose. React Native's launch options (.url) and expo-linking's ExpoLinkingRegistry.initialURL each hold a single initial URL. Forwarding more would let the later open: overwrite expo-linking's value while React Native kept the first, so the two would disagree. That reason is now a code comment.

Checked on the iOS 27 simulator (Xcode 27): the clean-prebuild Release build succeeds and the app launches. Opening orca://pair?code=… both cold and warm leaves the app running, with no new crash report.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — one commit (3a58d7d) on top of the reviewed c12fa53, touching the running-scene URL path in mobile/plugins/ios-scene-lifecycle.js and one assertion in its test.

  • Forwarded every URL a running scene receives — scene(_:openURLContexts:) now iterates all delivered UIOpenURLContexts, building per-context sourceApplication options and forwarding each to the app delegate, instead of dropping every context after the first. A second orca://pair in the same batch now reaches Expo Linking.
  • Kept the cold-start path single-URL on purpose — willConnectTo still uses urlContexts.first, with an inline rationale: RN's launch options and Expo's initialURL registry each hold one initial URL, so forwarding more than one would make the two disagree.
  • Added a test assertion that the emitted delegate loops over URLContexts and no longer references URLContexts.first.

I checked the generated Swift: URLContexts is the internal parameter name for openURLContexts, and cold-start URLs arrive through connectionOptions while warm ones arrive through this method, so the loop cannot double-deliver. This adopts the concern CodeRabbit raised against the previous commit, and the cold-start carve-out is sound. All prior Pullfrog threads remain resolved.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
ast-grep outline mobile/plugins/ios-scene-lifecycle.js --items all
ast-grep outline mobile/scripts/ios-scene-lifecycle-plugin.test.ts --items all
rg -n -C 12 'openURLContexts|URLContexts\.first|for .*URLContexts|initialURL|Cold start|cold start' mobile/plugins/ios-scene-lifecycle.js mobile/scripts/ios-scene-lifecycle-plugin.test.ts
git show --stat --oneline 3a58d7dd94 -- mobile/plugins/ios-scene-lifecycle.js mobile/scripts/ios-scene-lifecycle-plugin.test.ts

Length of output: 6466


@b1nhm1nh, thanks for the fix and the cold-start explanation. I checked the plugin source: scene(_:openURLContexts:) now forwards every URL context to the app delegate. The test also asserts that it does not use URLContexts.first. This addresses my warm-scene finding.

Your iOS 27 simulator results are encouraging. I did not run the build or tests here.


✏️ Learnings added
Learnt from: b1nhm1nh
URL: https://github.com/stablyai/orca/pull/22515

Timestamp: 2026-09-25T15:34:37.528Z
Learning: In `mobile/plugins/ios-scene-lifecycle.js`, cold-start scene URL handling intentionally forwards only the first URL context. React Native launch options (`.url`) and expo-linking's `ExpoLinkingRegistry.initialURL` each hold one initial URL. Forwarding additional cold-start URLs through `open:` could overwrite expo-linking's initial URL without changing React Native's initial URL.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

b1nhm1nh and others added 5 commits October 17, 2026 14:56
An app built with the iOS 27 SDK and no scene manifest traps at launch
in UIKit (`_UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption`).
Expo SDK 55's template still builds its window in didFinishLaunching, so
every Xcode 27 build of Orca crashed before JS ran.

- plugins/ios-scene-lifecycle.js declares a single-scene manifest and
  moves window creation and React Native startup into a SceneDelegate;
  cold-start and warm URL/universal links are forwarded to the app
  delegate so pairing links keep working. It throws if the Expo template
  changes shape instead of silently skipping.
- Raise the iOS deployment target to 16.0: expo-router's LinkPreview uses
  a UIKit API that is iOS 16+, and Xcode 27 no longer builds pods below 15.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`ios.deploymentTarget` sets the app target and the Podfile platform, but
each pod keeps its podspec minimum (SDWebImage 9.0, RNSVG 12.4,
RNCAsyncStorage 13.4, React Native's 15.1). Xcode 27 rejects pods below
iOS 15, and expo-router's LinkPreview needs 16, so a clean prebuild still
failed. plugins/ios-pod-deployment-target.js appends a post_install step,
after react_native_post_install, that raises (never lowers) each pod
build configuration to the app's target, and throws if the Podfile
template stops matching.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…delegate

Once the app declares a scene manifest, UIKit stops sending foreground and
background callbacks to the app delegate, so Expo's subscribers never heard
them. The scene delegate now forwards all four. A cold-start deep link or
universal link now also goes through the app delegate, so expo-linking's
initial URL matches React Native's.

Tests now run the plugins' registered mods and check the app.json entries,
so dropping the wiring fails the suite.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The app floor moved to iOS 16.0; the two local module podspecs and one comment
still cited 15.1.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scene(_:openURLContexts:) forwarded only the first URL context, so a
second link delivered in the same batch never reached React Native or
expo-linking. It now forwards each one.

Cold start still forwards only the first: React Native's launch options
and expo-linking's registry each hold a single initial URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@b1nhm1nh
b1nhm1nh force-pushed the fix/ios-scene-lifecycle branch from b4136e4 to 5e4571b Compare October 17, 2026 08:32

This branch has not been deployed

No deployments
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.

1 participant