Skip to content

Commit 0e7b5f1

Browse files
author
Doron Pearl
committed
added launchOptions to RCCManager
1 parent fe011d6 commit 0e7b5f1

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Since `react-native-controllers` takes over the skeleton of your app, we're firs
155155
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
156156
157157
// this is your new React Native invocation
158-
[[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
158+
[[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];
159159
160160
return YES;
161161
}

example/ios/ControllersExample/AppDelegate.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3535

3636
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
3737
self.window.backgroundColor = [UIColor whiteColor];
38-
[[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
38+
[[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];
3939

4040
return YES;
4141
}

ios/RCCManager.h

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
+ (instancetype)sharedIntance;
99

1010
-(void)initBridgeWithBundleURL:(NSURL *)bundleURL;
11+
-(void)initBridgeWithBundleURL:(NSURL *)bundleURL launchOptions:(NSDictionary *)launchOptions;
1112
-(RCTBridge*)getBridge;
1213
-(UIWindow*)getAppWindow;
1314

ios/RCCManager.m

+7-2
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,16 @@ -(id)getControllerWithId:(NSString*)componentId componentType:(NSString*)compone
117117
}
118118

119119
-(void)initBridgeWithBundleURL:(NSURL *)bundleURL
120+
{
121+
[self initBridgeWithBundleURL :bundleURL launchOptions:nil];
122+
}
123+
124+
-(void)initBridgeWithBundleURL:(NSURL *)bundleURL launchOptions:(NSDictionary *)launchOptions
120125
{
121126
if (self.sharedBridge) return;
122-
127+
123128
self.bundleURL = bundleURL;
124-
self.sharedBridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
129+
self.sharedBridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
125130

126131
[self showSplashScreen];
127132
}

0 commit comments

Comments
 (0)