GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(ios): raise orientationChanged from scene geometry updates by NathanWalker · Pull Request #11638 · NativeScript/NativeScript

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
  • You have signed the CLA.
  • All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#unit-testing.
  • Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md.

What is the current behavior?

On iOS 27, Application.orientationChangedEvent (and the per-window orientationChanged event) never fires when the device rotates. Android is unaffected.

The only iOS trigger for orientation changes was UIApplicationDidChangeStatusBarOrientationNotification, deprecated since iOS 13. Scene-based apps no longer get it on iOS 27, so rotations are never picked up. The orientation is still correct when read, but no event fires.

What is the new behavior?

The scene delegate now listens for scene geometry changes and resyncs the window's orientation from them:

  • windowScene:didUpdateEffectiveGeometry: on iOS 26+
  • windowScene:didUpdateCoordinateSpace:interfaceOrientation:traitCollection: on iOS 13–25

Each callback calls a new internal IOSNativeWindow._syncOrientation(). _setOrientation already skips unchanged values, so if iOS calls both callbacks, or the old notification also arrives, only one event fires. IOSNativeWindow now reads effectiveGeometry.interfaceOrientation when it exists, because UIWindowScene.interfaceOrientation is deprecated in iOS 26. The status bar notification observer is kept as a fallback for apps that don't use scenes.

Tests: application/scene-orientation.ios.spec.ts covers both delegate callbacks, the effective-geometry read, the duplicate-event check, and scenes with no window. Full core:test passes and tsc on tsconfig.lib.json is clean.

Manual test: on an iOS 26/27 simulator or device, subscribe to Application.on(Application.orientationChangedEvent, …) and rotate. The event should fire once per rotation with newValue set to landscape or portrait, and the ns-landscape/ns-portrait root CSS classes should update.

Closes #11635.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@NathanWalker
fix(ios): raise orientationChanged from scene geometry updates
0307d77
iOS 27 no longer posts UIApplicationDidChangeStatusBarOrientationNotification
to scene-based apps, so Application.orientationChangedEvent and the per-window
orientationChanged event stopped firing on rotation.

The scene delegate now implements windowScene:didUpdateEffectiveGeometry:
(iOS 26+) and windowScene:didUpdateCoordinateSpace:interfaceOrientation:traitCollection:
(iOS 13-25) and resyncs the window's orientation from them. Orientation is read
from effectiveGeometry.interfaceOrientation when available. The status bar
notification observer stays as a fallback for apps without scenes.

Closes #11635
@nx-cloud

nx-cloud Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 43b1fa9

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 11s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-12 19:48:01 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 43b1fa9

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

edusperoni
edusperoni reviewed Nov 12, 2026
View reviewed changes

@edusperoni edusperoni left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good overall: the scene geometry callbacks are the right hook, and _setOrientation's dedupe keeps it to one event per rotation. A few non-blocking nits:

  • Verify on iOS 27. CI covers the unit tests, but it'd be good to rotate a scene-manifest app on an iOS 27 simulator once and confirm the event fires exactly once per rotation (and that the CSS classes update).
  • Non-scene apps still rely only on UIApplicationDidChangeStatusBarOrientationNotification. The description says it still fires for them on iOS 27; worth confirming in the same test run, since if it doesn't, they stay broken.
  • Embedded mode (NativeScriptEmbedder) isn't covered: the host app owns the scene delegate, so these callbacks never run there and it keeps depending on the deprecated notification. Fine to leave for a follow-up, just flagging it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/core/application/application.ios.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

NathanWalker and others added 2 commits November 12, 2026 09:17
@NathanWalker @edusperoni
chore: better comment
b260cfb
Co-authored-by: Eduardo Speroni <[email protected]>
@NathanWalker
chore(ios): correct scene orientation callback comment
43b1fa9
@NathanWalker NathanWalker mentioned this pull request Nov 12, 2026
iOS 27: orientationChanged not raised in embedded mode (NativeScriptEmbedder) #11639
Open
@NathanWalker

NathanWalker commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I tested all three points on real runtimes, using apps/toolbox with temporary logging at each trigger and an orientationChangedEvent listener that reads the root CSS classes:

Setup Rotations Events Triggers that fired
iOS 27.0 sim, scene manifest 4 4 effective-geometry + coordinate-space (no status bar notification)
iPhone 16 Pro, iOS 26.6.2, scene manifest, rotated by hand 10 10 status bar notification + effective-geometry + coordinate-space
iOS 27.0 sim, no scene manifest, binary stamped SDK 26.0 4 4 status bar notification only

In every run the classes switched between ns-landscape and ns-portrait with each event. On the simulators I rotated with requestGeometryUpdate, since simctl can't rotate.

  • iOS 27: the notification never arrives for scene apps, which confirms the bug. The new callbacks pick up every rotation with exactly one event each.
  • Non-scene apps: if built with the iOS 27 SDK, they don't launch on iOS 27 at all. UIKit traps in _UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption, enforcing Apple's scene-lifecycle requirement. Built with the iOS 26 SDK, they still get the status bar notification on iOS 27, so the fallback covers them.
  • Comment: iOS 26+ actually calls both geometry callbacks per rotation, and iOS 26 also still posts the notification, so up to three triggers per rotation all collapse into one event. I fixed the comment to say that, and removed a duplicated line left over from applying the suggestion (43b1fa9).
  • Embedded mode: tracked in iOS 27: orientationChanged not raised in embedded mode (NativeScriptEmbedder) #11639.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@edusperoni edusperoni edusperoni left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Application 'orientationChangedEvent' no longer fires on iOS

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@NathanWalker @edusperoni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.