diff --git a/.github/workflows/testflight.yml b/.github/workflows/testflight.yml index 4e8ec9b726..b4d1583ddb 100644 --- a/.github/workflows/testflight.yml +++ b/.github/workflows/testflight.yml @@ -14,7 +14,7 @@ jobs: upload_to_testflight: name: Build and Upload React Native Sample to Testflight - runs-on: macos-26-xlarge + runs-on: xcode-27-xlarge needs: [diff_check] if: ${{ needs.diff_check.outputs.skip_ci != 'true' }} steps: diff --git a/samples/react-native/ios/Podfile b/samples/react-native/ios/Podfile index e0c97aadb5..76b9fb8c39 100644 --- a/samples/react-native/ios/Podfile +++ b/samples/react-native/ios/Podfile @@ -64,5 +64,16 @@ target 'sentryreactnativesample' do :mac_catalyst_enabled => ENV['ENABLE_MAC_CATALYST'] == '1', # :ccache_enabled => true ) + + # Xcode 27 rejects iOS deployment targets below 15.0. Some pods (and their resource + # bundle targets) still declare older ones, so raise them to the app's minimum. + installer.pods_project.targets.each do |target| + target.build_configurations.each do |build_config| + deployment_target = build_config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] + if deployment_target && Gem::Version.new(deployment_target) < Gem::Version.new(min_ios_version_supported) + build_config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_version_supported + end + end + end end end diff --git a/samples/react-native/ios/sentryreactnativesample/AppDelegate.h b/samples/react-native/ios/sentryreactnativesample/AppDelegate.h index 9a34444920..f5398b278b 100644 --- a/samples/react-native/ios/sentryreactnativesample/AppDelegate.h +++ b/samples/react-native/ios/sentryreactnativesample/AppDelegate.h @@ -4,7 +4,15 @@ @interface AppDelegate : RCTDefaultReactNativeFactoryDelegate -@property (nonatomic, strong, nonnull) UIWindow *window; +// Set by SceneDelegate. UIKit takes the window from the scene, but tests read it from here. +@property (nonatomic, strong, nullable) UIWindow *window; @property (nonatomic, strong, nonnull) RCTReactNativeFactory *reactNativeFactory; @end + +// Apps built with the iOS 27 SDK must use the UIScene life cycle or they don't launch (TN3187). +@interface SceneDelegate : UIResponder + +@property (nonatomic, strong, nullable) UIWindow *window; + +@end diff --git a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm index b0fdf8ea61..03e3084442 100644 --- a/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm +++ b/samples/react-native/ios/sentryreactnativesample/AppDelegate.mm @@ -42,12 +42,7 @@ - (BOOL)application:(UIApplication *)application self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; self.dependencyProvider = [RCTAppDependencyProvider new]; - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - - [self.reactNativeFactory startReactNativeWithModuleName:@"sentry-react-native-sample" - inWindow:self.window - initialProperties:@{ } - launchOptions:launchOptions]; + // React Native starts in SceneDelegate once the window scene connects. [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; @@ -96,3 +91,25 @@ - (BOOL)shouldCrashOnStart } @end + +@implementation SceneDelegate + +- (void)scene:(UIScene *)scene + willConnectToSession:(UISceneSession *)session + options:(UISceneConnectionOptions *)connectionOptions +{ + if (![scene isKindOfClass:[UIWindowScene class]]) { + return; + } + + AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; + self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene]; + appDelegate.window = self.window; + + [appDelegate.reactNativeFactory startReactNativeWithModuleName:@"sentry-react-native-sample" + inWindow:self.window + initialProperties:@{ } + connectionOptions:connectionOptions]; +} + +@end diff --git a/samples/react-native/ios/sentryreactnativesample/Info.plist b/samples/react-native/ios/sentryreactnativesample/Info.plist index c41ae3d892..11edad35e7 100644 --- a/samples/react-native/ios/sentryreactnativesample/Info.plist +++ b/samples/react-native/ios/sentryreactnativesample/Info.plist @@ -41,6 +41,23 @@ RCTNewArchEnabled + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + + + + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities