diff --git a/Libraries/LinkingIOS/RCTLinkingManager.m b/Libraries/LinkingIOS/RCTLinkingManager.m index 953898129..96f9e75b4 100644 --- a/Libraries/LinkingIOS/RCTLinkingManager.m +++ b/Libraries/LinkingIOS/RCTLinkingManager.m @@ -21,6 +21,13 @@ NSString *const RCTOpenURLNotification = @"RCTOpenURLNotification"; RCT_EXPORT_MODULE() +- (instancetype)init +{ + // We're only overriding this to ensure the module gets created at startup + // TODO (t11106126): Remove once we have more declarative control over module setup. + return [super init]; +} + - (void)setBridge:(RCTBridge *)bridge { _bridge = bridge; diff --git a/Libraries/PushNotificationIOS/RCTPushNotificationManager.m b/Libraries/PushNotificationIOS/RCTPushNotificationManager.m index b9df76865..0d6453a36 100644 --- a/Libraries/PushNotificationIOS/RCTPushNotificationManager.m +++ b/Libraries/PushNotificationIOS/RCTPushNotificationManager.m @@ -59,10 +59,20 @@ RCT_EXPORT_MODULE() [[NSNotificationCenter defaultCenter] removeObserver:self]; } +- (instancetype)init +{ + // We're only overriding this to ensure the module gets created at startup + // TODO (t11106126): Remove once we have more declarative control over module setup. + return [super init]; +} + - (void)setBridge:(RCTBridge *)bridge { _bridge = bridge; + // TODO: if we add an explicit "startObserving" method, we can take this out + // of the application startup path + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleLocalNotificationReceived:) name:RCTLocalNotificationReceived diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index 5e60f97a9..f2d6e6ccb 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -303,7 +303,7 @@ RCT_EXTERN NSArray *RCTGetModuleClasses(void); // The executor is a bridge module, but we want it to be instantiated before // any other module has access to the bridge, in case they need the JS thread. - // TODO: once we have more fine-grained control of init (D3175632) we can + // TODO: once we have more fine-grained control of init (t11106126) we can // probably just replace this with [self moduleForClass:self.executorClass] if (!_javaScriptExecutor) { id executorModule = [self.executorClass new]; diff --git a/React/Base/RCTKeyboardObserver.m b/React/Base/RCTKeyboardObserver.m index 88523a549..a849c3d5a 100644 --- a/React/Base/RCTKeyboardObserver.m +++ b/React/Base/RCTKeyboardObserver.m @@ -19,6 +19,13 @@ static NSDictionary *RCTParseKeyboardNotification(NSNotification *notification); RCT_EXPORT_MODULE() +- (instancetype)init +{ + // We're only overriding this to ensure the module gets created at startup + // TODO (t11106126): Remove once we have more declarative control over module setup. + return [super init]; +} + - (void)setBridge:(RCTBridge *)bridge { _bridge = bridge; diff --git a/React/Base/RCTPerformanceLogger.m b/React/Base/RCTPerformanceLogger.m index b30d1348d..05e6e418e 100644 --- a/React/Base/RCTPerformanceLogger.m +++ b/React/Base/RCTPerformanceLogger.m @@ -116,6 +116,13 @@ RCT_EXPORT_MODULE() @synthesize bridge = _bridge; +- (instancetype)init +{ + // We're only overriding this to ensure the module gets created at startup + // TODO (t11106126): Remove once we have more declarative control over module setup. + return [super init]; +} + - (void)setBridge:(RCTBridge *)bridge { _bridge = bridge; diff --git a/React/Modules/RCTDevLoadingView.m b/React/Modules/RCTDevLoadingView.m index 7305c186b..a451f79fc 100644 --- a/React/Modules/RCTDevLoadingView.m +++ b/React/Modules/RCTDevLoadingView.m @@ -43,7 +43,7 @@ RCT_EXPORT_MODULE() - (instancetype)init { // We're only overriding this to ensure the module gets created at startup - // TODO (D3175632): Remove once we have more declarative control over module setup. + // TODO (t11106126): Remove once we have more declarative control over module setup. return [super init]; } diff --git a/React/Modules/RCTStatusBarManager.m b/React/Modules/RCTStatusBarManager.m index 026d19012..5171c5aa9 100644 --- a/React/Modules/RCTStatusBarManager.m +++ b/React/Modules/RCTStatusBarManager.m @@ -46,10 +46,20 @@ RCT_EXPORT_MODULE() @synthesize bridge = _bridge; +- (instancetype)init +{ + // We're only overriding this to ensure the module gets created at startup + // TODO (t11106126): Remove once we have more declarative control over module setup. + return [super init]; +} + - (void)setBridge:(RCTBridge *)bridge { _bridge = bridge; + // TODO: if we add an explicit "startObserving" method, we can take this out + // of the application startup path + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(applicationDidChangeStatusBarFrame:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil]; [nc addObserver:self selector:@selector(applicationWillChangeStatusBarFrame:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil]; diff --git a/React/Profiler/RCTPerfMonitor.m b/React/Profiler/RCTPerfMonitor.m index 27e0b9bd4..947722534 100644 --- a/React/Profiler/RCTPerfMonitor.m +++ b/React/Profiler/RCTPerfMonitor.m @@ -128,7 +128,7 @@ RCT_EXPORT_MODULE() - (instancetype)init { // We're only overriding this to ensure the module gets created at startup - // TODO (D3175632): Remove once we have more declarative control over module setup. + // TODO (t11106126): Remove once we have more declarative control over module setup. return [super init]; }