I'm new to React Native, I'm trying to run my project on iPhone simulatorbut I keep getting red error screen: Could not connect to development server.
I changed the ip address in app delegate , and made sure that metro server is running on the same ip. and the address is accessible in Chrome and running. But no results whatsoever.
Here is my appDelegate.m file:
@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]]; NSURL *jsCodeLocation; jsCodeLocation = [NSURL URLWithString:@"http://192.168.0.103:8081/index.ios.bundle?platform=ios&dev=true"]; self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]]; [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions bridgeManagerDelegate:self]; [FIRApp configure]; return YES;}- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge{ NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge]; // If you'd like to export some custom RCTBridgeModules that are not Expo modules, add them here! return extraModules;}- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge{#if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];#else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];#endif}@end
I've looked into and tried many answers on StackOverFlow. But no results whatsoever.
Any help?