Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/RCCManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
-(UIWindow*)getAppWindow;
-(void)setAppStyle:(NSDictionary*)appStyle;
-(NSDictionary*)getAppStyle;
-(NSDictionary*)getInitialProps;

-(void)registerController:(UIViewController*)controller componentId:(NSString*)componentId componentType:(NSString*)componentType;
-(id)getControllerWithId:(NSString*)componentId componentType:(NSString*)componentType;
Expand Down
6 changes: 6 additions & 0 deletions ios/RCCManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ @interface RCCManager() <RCTBridgeDelegate>
@property (nonatomic, strong) RCTBridge *sharedBridge;
@property (nonatomic, strong) NSURL *bundleURL;
@property (nonatomic, strong, readwrite) NSDictionary *globalAppStyle;
@property (nonatomic, strong) NSDictionary *launchOptions;
@end

@implementation RCCManager
Expand Down Expand Up @@ -46,6 +47,10 @@ - (instancetype)init
return self;
}

- (NSDictionary *)getInitialProps {
return _launchOptions;
}

-(void)clearModuleRegistry
{
[self.modulesRegistry removeAllObjects];
Expand Down Expand Up @@ -155,6 +160,7 @@ -(void)initBridgeWithBundleURL:(NSURL *)bundleURL launchOptions:(NSDictionary *)
{
if (self.sharedBridge) return;

self.launchOptions = launchOptions;
self.bundleURL = bundleURL;
self.sharedBridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

Expand Down
5 changes: 5 additions & 0 deletions ios/RCCManagerModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -480,4 +480,9 @@ -(BOOL)viewControllerIsModal:(UIViewController*)viewController
[RCCManagerModule cancelAllRCCViewControllerReactTouches];
}

RCT_EXPORT_METHOD(getInitialProps:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{
resolve([[RCCManager sharedInstance] getInitialProps]);
}

@end
7 changes: 6 additions & 1 deletion src/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ function dismissInAppNotification(params = {}) {
return platformSpecific.dismissInAppNotification(params);
}

async function getInitialProps() {
return await platformSpecific.getInitialProps();
}

async function startTabBasedApp(params) {
try {
return await platformSpecific.startTabBasedApp(params);
Expand Down Expand Up @@ -200,5 +204,6 @@ export default {
clearEventHandler: clearEventHandler,
handleDeepLink: handleDeepLink,
isAppLaunched: isAppLaunched,
isRootLaunched: isRootLaunched
isRootLaunched: isRootLaunched,
getInitialProps: getInitialProps
};
3 changes: 3 additions & 0 deletions src/deprecated/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ var Controllers = {
_validateDrawerProps(layout);
_processProperties(_.get(layout, 'props.appStyle', {}));
return await RCCManager.setRootController(layout, animationType, passProps);
},
getInitialProps: async function() {
return await RCCManager.getInitialProps();
}
},

Expand Down
7 changes: 6 additions & 1 deletion src/deprecated/platformSpecificDeprecated.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ function dismissLightBox(params) {
Modal.dismissLightBox();
}

async function getInitialProps() {
return await ControllerRegistry.getInitialProps();
}

function showInAppNotification(params) {
if (!params.screen) {
console.error('showInAppNotification(params): params.screen is required');
Expand Down Expand Up @@ -721,5 +725,6 @@ export default {
navigatorToggleNavBar,
showContextualMenu,
dismissContextualMenu,
getCurrentlyVisibleScreenId
getCurrentlyVisibleScreenId,
getInitialProps
};