From 87a7cb3d062bfbc46eaa53149022c2fd46b7e8ad Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 30 Jul 2025 13:48:34 +0100 Subject: [PATCH] Fix search paths and push forward with the app --- .../RNTestApp.xcodeproj/project.pbxproj | 10 ++-- .../RNTestApp/RNTestApp/AppDelegate.m | 31 +++++----- .../RNTestApp/Base.lproj/Main.storyboard | 24 -------- .../RNTestApp/RNTestApp/Info.plist | 22 +------ .../RNTestApp/RNTestApp/SceneDelegate.h | 15 ----- .../RNTestApp/RNTestApp/SceneDelegate.m | 57 ------------------- 6 files changed, 19 insertions(+), 140 deletions(-) delete mode 100644 packages/ios-test-app/RNTestApp/RNTestApp/Base.lproj/Main.storyboard delete mode 100644 packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.h delete mode 100644 packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.m diff --git a/packages/ios-test-app/RNTestApp/RNTestApp.xcodeproj/project.pbxproj b/packages/ios-test-app/RNTestApp/RNTestApp.xcodeproj/project.pbxproj index 568614ad3b0..15a6965cefd 100644 --- a/packages/ios-test-app/RNTestApp/RNTestApp.xcodeproj/project.pbxproj +++ b/packages/ios-test-app/RNTestApp/RNTestApp.xcodeproj/project.pbxproj @@ -155,13 +155,12 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( - "/Users/cipolleschi/Official/react-native/packages/react-native/.build/headers", - "/Users/cipolleschi/Official/react-native/packages/react-native/ReactCommon/yoga", + "$(PROJECT_DIR)/../../react-native/ReactCommon/yoga", + "$(PROJECT_DIR)/../../react-native/.build/headers", ); INFOPLIST_FILE = RNTestApp/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( @@ -185,13 +184,12 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( - "/Users/cipolleschi/Official/react-native/packages/react-native/.build/headers", - "/Users/cipolleschi/Official/react-native/packages/react-native/ReactCommon/yoga", + "$(PROJECT_DIR)/../../react-native/ReactCommon/yoga", + "$(PROJECT_DIR)/../../react-native/.build/headers", ); INFOPLIST_FILE = RNTestApp/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/packages/ios-test-app/RNTestApp/RNTestApp/AppDelegate.m b/packages/ios-test-app/RNTestApp/RNTestApp/AppDelegate.m index 39f9ce85f4a..214887a7266 100644 --- a/packages/ios-test-app/RNTestApp/RNTestApp/AppDelegate.m +++ b/packages/ios-test-app/RNTestApp/RNTestApp/AppDelegate.m @@ -7,34 +7,31 @@ #import "AppDelegate.h" +#import +#import + @interface AppDelegate () @end @implementation AppDelegate - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. + + self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self]; + self.dependencyProvider = [RCTAppDependencyProvider new]; + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp" + inWindow:self.window + initialProperties:@{} + launchOptions:launchOptions]; return YES; } - -#pragma mark - UISceneSession lifecycle - - -- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +- (NSURL *)bundleURL +{ + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"js/RNTesterApp.ios"]; } - -- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. -} - - @end diff --git a/packages/ios-test-app/RNTestApp/RNTestApp/Base.lproj/Main.storyboard b/packages/ios-test-app/RNTestApp/RNTestApp/Base.lproj/Main.storyboard deleted file mode 100644 index 808a21ce779..00000000000 --- a/packages/ios-test-app/RNTestApp/RNTestApp/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/ios-test-app/RNTestApp/RNTestApp/Info.plist b/packages/ios-test-app/RNTestApp/RNTestApp/Info.plist index 81ed29b76cf..0c67376ebac 100644 --- a/packages/ios-test-app/RNTestApp/RNTestApp/Info.plist +++ b/packages/ios-test-app/RNTestApp/RNTestApp/Info.plist @@ -1,25 +1,5 @@ - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - SceneDelegate - UISceneStoryboardFile - Main - - - - - + diff --git a/packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.h b/packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.h deleted file mode 100644 index 666b89677a7..00000000000 --- a/packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// SceneDelegate.h -// RNTestApp -// -// Created by Riccardo Cipolleschi on 29/07/2025. -// - -#import - -@interface SceneDelegate : UIResponder - -@property (strong, nonatomic) UIWindow * window; - -@end - diff --git a/packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.m b/packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.m deleted file mode 100644 index f954f46ae58..00000000000 --- a/packages/ios-test-app/RNTestApp/RNTestApp/SceneDelegate.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// SceneDelegate.m -// RNTestApp -// -// Created by Riccardo Cipolleschi on 29/07/2025. -// - -#import "SceneDelegate.h" - -@interface SceneDelegate () - -@end - -@implementation SceneDelegate - - -- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). -} - - -- (void)sceneDidDisconnect:(UIScene *)scene { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). -} - - -- (void)sceneDidBecomeActive:(UIScene *)scene { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. -} - - -- (void)sceneWillResignActive:(UIScene *)scene { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). -} - - -- (void)sceneWillEnterForeground:(UIScene *)scene { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. -} - - -- (void)sceneDidEnterBackground:(UIScene *)scene { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. -} - - -@end