Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): iPhones on iOS 27.2 beta no longer open to a black screen #18654

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/18654/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 30 additions and 5 deletions.

x
0 of 2 viewed, 2 left
12 additions and 0 deletionsapps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swiftModified
View file
@@ -35,9 +35,21 @@
override func didMoveToWindow() {
super.didMoveToWindow()
lastMetrics = nil
+ assumeNoHingeIfSilent()
publishMetrics()
​
+ /// UIKit only sends hinge updates on devices that have a hinge. Without this,
+ /// an ordinary iPhone never publishes and the navigator never attaches.
+ private func assumeNoHingeIfSilent() {
+ guard window != nil, hasHinge == nil else { return }
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { [weak self] in
+ guard let self, self.window != nil, self.hasHinge == nil else { return }
+ self.hasHinge = false
+ self.publishMetrics()
+ }
+ }
+​
override func layoutSubviews() {
super.layoutSubviews()
publishMetrics()
18 additions and 5 deletionsapps/mobile/src/native/NativeWorkspaceColumns.ios.tsxModified
View file
@@ -1,4 +1,5 @@
import { requireOptionalNativeModule } from "expo";
+import { useEffect, useState } from "react";
import { Platform } from "react-native";
import { useNativeLayoutMetrics } from "./native-layout-metrics";