Skip to content

Commit 0219790

Browse files
committed
chore: iOS/XCode 27 compatibility
1 parent f7acd19 commit 0219790

7 files changed

Lines changed: 74 additions & 25 deletions

File tree

.yarnrc.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
enableGlobalCache: true
22

3-
enableHardenedMode: true
4-
53
enableScripts: false
64

75
enableTelemetry: false

examples/SampleApp/ios/AppDelegate.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ import FirebaseMessaging
77

88
@main
99
class AppDelegate: UIResponder, UIApplicationDelegate {
10+
// Unused with the scene lifecycle (SceneDelegate owns the window), but Firebase's
11+
// app delegate proxy (GULAppDelegateSwizzler) exposes the optional `window` selector,
12+
// so UIKit calls it and crashes if the property is missing.
1013
var window: UIWindow?
11-
14+
1215
var reactNativeDelegate: ReactNativeDelegate?
1316
var reactNativeFactory: RCTReactNativeFactory?
14-
17+
// Kept for SceneDelegate, which starts React Native once the scene connects
18+
var launchOptions: [UIApplication.LaunchOptionsKey: Any]?
19+
1520
func application(
1621
_ application: UIApplication,
1722
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
@@ -23,14 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2328

2429
reactNativeDelegate = delegate
2530
reactNativeFactory = factory
26-
27-
window = UIWindow(frame: UIScreen.main.bounds)
28-
29-
factory.startReactNative(
30-
withModuleName: "SampleApp",
31-
in: window,
32-
launchOptions: launchOptions
33-
)
31+
self.launchOptions = launchOptions
3432

3533
return true
3634
}

examples/SampleApp/ios/Podfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ target 'SampleApp' do
7575
installer.pods_project.targets.each do |target|
7676
target.build_configurations.each do |config|
7777
config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
78+
# Some pods pin an iOS deployment target (e.g. 13.0) below the range
79+
# supported by current Xcode. Clamp them up to the app's minimum.
80+
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < min_ios_version_supported.to_f
81+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_version_supported
82+
end
83+
end
84+
end
85+
86+
# The Pods project itself can also carry a stale project-level setting.
87+
installer.pods_project.build_configurations.each do |config|
88+
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < min_ios_version_supported.to_f
89+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_version_supported
7890
end
7991
end
8092
end

examples/SampleApp/ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,7 @@ SPEC CHECKSUMS:
32273227
GoogleAppMeasurement: 57270ccc2b77472d7e85c4cbe45972564eff78bb
32283228
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
32293229
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
3230-
hermes-engine: d8f4d6c98c2ea2858468ad58fbf6b3a0b33e4da6
3230+
hermes-engine: b79f183911245b3275df65c55a128c726513c9d6
32313231
libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7
32323232
libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f
32333233
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
@@ -3245,7 +3245,7 @@ SPEC CHECKSUMS:
32453245
React: e2dc35338068bbd299c66f043ae0d7f25de8499e
32463246
React-callinvoker: 28b25d21b124c26cebaea713ba7d801b9351dc48
32473247
React-Core: 02ed7d2ffb70437bdf2aba074a13078a7b0b9ff0
3248-
React-Core-prebuilt: 07da8c06ca047a4047eb44266cd74e1f422d7655
3248+
React-Core-prebuilt: 20720c0f7e2cc18477561f84fe6d63a1cd351e25
32493249
React-CoreModules: b3a5a42dadcde3b5d47b325bd912eb2ced89e146
32503250
React-cxxreact: fe8f88dda044e5905e99a00f41b7a874c3908716
32513251
React-debug: 9af1e96a6069c996e3d9f1e493603e74bc9f1593
@@ -3317,7 +3317,7 @@ SPEC CHECKSUMS:
33173317
ReactAppDependencyProvider: 25c9c516839be2c5e3d3344f95dc7da5f7e63fc2
33183318
ReactCodegen: 7016a2114079361a2f1536b3c91a15ceb8eb7ca4
33193319
ReactCommon: 7dfc3250793bf36cf221096ff59e1179e13eef7f
3320-
ReactNativeDependencies: b494f9d4ef665da25093dffcdd0b1a110475f404
3320+
ReactNativeDependencies: e5bed54c1e4961f7fbc7333c31159f7969176b88
33213321
RNCClipboard: 7a7d4557bfd3370b35c99dfecd92ae7b9fc4948a
33223322
RNFastImage: 14580cef91660b889645fb9e87f58a53621db993
33233323
RNFBApp: 3b942e786ca88524ba17df665a1a360fb3eee525
@@ -3338,6 +3338,6 @@ SPEC CHECKSUMS:
33383338
Teleport: 58dccc8594d74a77cdc2a2191b60656f9aaac743
33393339
Yoga: e240fec777ff1f21ef42ccebbb44b6d262125855
33403340

3341-
PODFILE CHECKSUM: 265665a90a2835886ea9693f40400a18ed64d6e5
3341+
PODFILE CHECKSUM: ac9682db83e42d63d399a8de4586161e86b3e751
33423342

3343-
COCOAPODS: 1.15.2
3343+
COCOAPODS: 1.16.2

examples/SampleApp/ios/SampleApp.xcodeproj/project.pbxproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
00E356F31AD99517003FC87E /* SampleAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SampleAppTests.m */; };
1111
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
12+
7C2725B22FF8020100AEF119 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2725B12FF8020100AEF119 /* SceneDelegate.swift */; };
1213
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
1314
A1FEDE8CBBE9D0E21A2E7B50 /* Pods_SampleApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A95C98F43B825F087087E8A /* Pods_SampleApp.framework */; };
1415
DEC527FA32B96531C12C9B0E /* Pods_SampleApp_SampleAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D8F9A1C211E5EA27FA5C573 /* Pods_SampleApp_SampleAppTests.framework */; };
@@ -35,6 +36,7 @@
3536
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SampleApp/Images.xcassets; sourceTree = "<group>"; };
3637
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SampleApp/Info.plist; sourceTree = "<group>"; };
3738
5CA034D157E1D7F2B7696EF5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = SampleApp/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
39+
7C2725B12FF8020100AEF119 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
3840
7D8F9A1C211E5EA27FA5C573 /* Pods_SampleApp_SampleAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleApp_SampleAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3941
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SampleApp/LaunchScreen.storyboard; sourceTree = "<group>"; };
4042
8A95C98F43B825F087087E8A /* Pods_SampleApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -99,6 +101,7 @@
99101
FCA5E58C254B70E600B4E978 /* GoogleService-Info.plist */,
100102
5CA034D157E1D7F2B7696EF5 /* PrivacyInfo.xcprivacy */,
101103
FDE391DE2D68D512005AA9DC /* SampleApp-Bridging-Header.h */,
104+
7C2725B12FF8020100AEF119 /* SceneDelegate.swift */,
102105
);
103106
name = SampleApp;
104107
sourceTree = "<group>";
@@ -417,6 +420,7 @@
417420
buildActionMask = 2147483647;
418421
files = (
419422
FDE391DD2D68D510005AA9DC /* AppDelegate.swift in Sources */,
423+
7C2725B22FF8020100AEF119 /* SceneDelegate.swift in Sources */,
420424
);
421425
runOnlyForDeploymentPostprocessing = 0;
422426
};
@@ -706,10 +710,7 @@
706710
"-DFOLLY_CFG_NO_COROUTINES=1",
707711
"-DRCT_REMOVE_LEGACY_ARCH=1",
708712
);
709-
OTHER_LDFLAGS = (
710-
"$(inherited)",
711-
" ",
712-
);
713+
OTHER_LDFLAGS = "$(inherited) ";
713714
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
714715
SDKROOT = iphoneos;
715716
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -860,10 +861,7 @@
860861
"-DFOLLY_CFG_NO_COROUTINES=1",
861862
"-DRCT_REMOVE_LEGACY_ARCH=1",
862863
);
863-
OTHER_LDFLAGS = (
864-
"$(inherited)",
865-
" ",
866-
);
864+
OTHER_LDFLAGS = "$(inherited) ";
867865
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
868866
SDKROOT = iphoneos;
869867
SWIFT_ENABLE_EXPLICIT_MODULES = NO;

examples/SampleApp/ios/SampleApp/Info.plist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@
4747
<string>$(PRODUCT_NAME) would like access to your photo gallery to share image in a message.</string>
4848
<key>RCTNewArchEnabled</key>
4949
<true/>
50+
<key>UIApplicationSceneManifest</key>
51+
<dict>
52+
<key>UIApplicationSupportsMultipleScenes</key>
53+
<false/>
54+
<key>UISceneConfigurations</key>
55+
<dict>
56+
<key>UIWindowSceneSessionRoleApplication</key>
57+
<array>
58+
<dict>
59+
<key>UISceneConfigurationName</key>
60+
<string>Default Configuration</string>
61+
<key>UISceneDelegateClassName</key>
62+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
63+
</dict>
64+
</array>
65+
</dict>
66+
</dict>
5067
<key>UILaunchStoryboardName</key>
5168
<string>LaunchScreen</string>
5269
<key>UIRequiredDeviceCapabilities</key>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import UIKit
2+
3+
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4+
var window: UIWindow?
5+
6+
func scene(
7+
_ scene: UIScene,
8+
willConnectTo session: UISceneSession,
9+
options connectionOptions: UIScene.ConnectionOptions
10+
) {
11+
guard let windowScene = scene as? UIWindowScene else { return }
12+
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate,
13+
let factory = appDelegate.reactNativeFactory else { return }
14+
15+
let window = UIWindow(windowScene: windowScene)
16+
17+
// startReactNative sets the rootViewController and makes the window key and visible
18+
factory.startReactNative(
19+
withModuleName: "SampleApp",
20+
in: window,
21+
launchOptions: appDelegate.launchOptions
22+
)
23+
24+
self.window = window
25+
}
26+
}

0 commit comments

Comments
 (0)