Skip to content

fix: Adopt scene lifecycle in sample apps#8351

Open
denrase wants to merge 9 commits into
mainfrom
fix/ios-27-scene-lifecycle-sample-app
Open

fix: Adopt scene lifecycle in sample apps#8351
denrase wants to merge 9 commits into
mainfrom
fix/ios-27-scene-lifecycle-sample-app

Conversation

@denrase

@denrase denrase commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

#skip-changelog

📜 Description

Adopts the scene-based lifecycle in sample apps that failed to launch when built with the iOS 27 SDK.

Updated affected UIKit/AppDelegate-based samples to include a scene manifest, scene configuration, and scene delegate.

Removes window references from AppDelegate instances. Components that needed these (Debug Menu) are now being installed through SceneDelegate.

Introduced a helper to find active window or top controller.

Removed alerts from feedback callbacks, as they were interfering with the feedback, not a valid usecase.

💡 Motivation and Context

Fixes part of #8124

Apps built with the iOS/tvOS/visionOS 27 SDK must adopt the UIKit scene-based lifecycle. Without it, affected samples fail at launch with:

failure in void _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption(void)_block_invoke (UIApplication_RuntimeIssues.m:106) : Application failed to launch: UIScene life cycle
is required for apps built with this SDK. See Technote TN3187 for more information on migration.

See Apple Technote TN3187:
https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle

Also fixed the watchOS sample storyboard module reference so the hosting controller can be instantiated.

💚 How did you test it?

Tested with Xcode 27 beta 2.

iOS

  • iOS-Swift
  • iOS-Swift6
  • iOS-SwiftUI
  • iOS15-SwiftUI
  • iOS-SwiftUI-SPM
  • iOS-SwiftUI-Widgets
  • iOS-ObjectiveC
  • iOS-ObjectiveC-Dynamic
  • iOS-ObjectiveC-Static
  • iOS-ObjectiveCpp-NoModules
  • SessionReplay-CameraTest
  • DistributionSample
  • SDK-Size
  • SPM

tvOS

  • tvOS-Swift
  • tvOS-SBSwift
  • tvOS-SwiftUI-SPM

watchOS

  • watchOS-Swift (watchOS only works with 9, as Xcode 27 is dropping 8)

visionOS

  • visionOS-Swift
  • visionOS-SwiftUI-SPM

macOS

I ahve no way currently to test the macOS betas.

  • macOS-Swift
  • macOS-SwiftUI
  • macOS-SwiftUI-SPM
  • macOS-CLI-Xcode

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

denrase added 4 commits July 6, 2026 17:04
Adopts the UIKit scene-based lifecycle in sample apps that failed to launch when built with the iOS 27 SDK.
Kept watchOS device support at 8.0, but raised the simulator-only deployment target to 9.0 because Xcode 27 no longer supports watchOS 8 simulators.

Also fixed the watchOS sample storyboard module reference so the hosting controller can be instantiated.
@denrase denrase marked this pull request as ready for review July 7, 2026 08:42
@denrase denrase added ready-to-merge Use this label to trigger all PR workflows and removed skip-changelog labels Jul 7, 2026
Comment thread Samples/iOS-Swift/App/Sources/AppDelegate.swift
@sentry

sentry Bot commented Jul 7, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.21.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1214.81 ms 1256.33 ms 41.51 ms
Size 24.14 KiB 1.23 MiB 1.20 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8693a8f 1222.37 ms 1249.31 ms 26.95 ms
71859d3 1216.45 ms 1259.12 ms 42.67 ms
a250b4d 1217.19 ms 1250.80 ms 33.62 ms
3efa7b5 1226.55 ms 1260.66 ms 34.11 ms
3b7d81f 1220.53 ms 1239.06 ms 18.53 ms
9c19a06 1217.77 ms 1248.98 ms 31.21 ms
ec88236 1219.04 ms 1253.69 ms 34.65 ms
8bb6aeb 1232.15 ms 1260.78 ms 28.63 ms
f82ca9b 1227.06 ms 1264.67 ms 37.61 ms
66415de 1221.21 ms 1253.28 ms 32.07 ms

App size

Revision Plain With Sentry Diff
8693a8f 24.14 KiB 1.16 MiB 1.13 MiB
71859d3 24.14 KiB 1.17 MiB 1.15 MiB
a250b4d 24.14 KiB 1.22 MiB 1.20 MiB
3efa7b5 24.14 KiB 1.22 MiB 1.19 MiB
3b7d81f 24.14 KiB 1.22 MiB 1.20 MiB
9c19a06 24.14 KiB 1.16 MiB 1.13 MiB
ec88236 24.14 KiB 1.15 MiB 1.13 MiB
8bb6aeb 24.14 KiB 1.17 MiB 1.15 MiB
f82ca9b 24.14 KiB 1.17 MiB 1.14 MiB
66415de 24.14 KiB 1.16 MiB 1.13 MiB

Previous results on branch: fix/ios-27-scene-lifecycle-sample-app

Startup times

Revision Plain With Sentry Diff
3098248 1228.34 ms 1258.54 ms 30.20 ms

App size

Revision Plain With Sentry Diff
3098248 24.14 KiB 1.23 MiB 1.20 MiB

Comment thread Samples/iOS-Swift/App/Sources/SceneDelegate.swift Outdated
Comment thread Samples/iOS-Swift/AppClip/Sources/AppDelegate.swift Outdated
Comment thread Samples/iOS-Swift6/App/Sources/AppDelegate.swift Outdated
Comment thread Samples/SessionReplay-CameraTest/Sources/AppDelegate.swift Outdated
Comment thread Sources/Configuration/DeploymentTargets.xcconfig Outdated
@denrase denrase self-assigned this Jul 7, 2026
denrase added 2 commits July 10, 2026 13:19
- remove window refernces from appdelegate
- init debug button with windows scene references from SceneDelegate
- add helper to find active viewcontroller

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 212cd09. Configure here.

Comment thread Samples/iOS-SwiftUI/App/Sources/SwiftUIApp.swift
Comment thread Samples/SentrySampleShared/SentrySampleShared/SampleAppUI.swift
@denrase denrase requested a review from philprime July 10, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants