From edf71005b5a4d7cfb09eae14f5765d30b9c5704e Mon Sep 17 00:00:00 2001 From: Yan Soares Couto Date: Tue, 17 Jul 2018 07:03:21 -0700 Subject: [PATCH] Hiding pre-bundled notification when not on dev mode Summary: Notification "loading from pre-bundled file" won't show up anymore on non-dev mode. Reviewed By: adamjernst Differential Revision: D8874556 fbshipit-source-id: 8bfa63691beb65d16617409533f7a38dc00dc310 --- React/DevSupport/RCTDevLoadingView.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/React/DevSupport/RCTDevLoadingView.m b/React/DevSupport/RCTDevLoadingView.m index 15480ad6a69391..d0e1bb074ebc84 100644 --- a/React/DevSupport/RCTDevLoadingView.m +++ b/React/DevSupport/RCTDevLoadingView.m @@ -72,7 +72,7 @@ - (void)setBridge:(RCTBridge *)bridge self->_showDate = [NSDate date]; if (!self->_window && !RCTRunningInTestEnvironment()) { CGSize screenSize = [UIScreen mainScreen].bounds.size; - + if (@available(iOS 11.0, *)) { UIWindow *window = UIApplication.sharedApplication.keyWindow; self->_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, screenSize.width, window.safeAreaInsets.top + 30)]; @@ -131,6 +131,10 @@ - (void)showWithURL:(NSURL *)URL UIColor *backgroundColor; NSString *source; if (URL.fileURL) { + // If dev mode is not enabled, we don't want to show this kind of notification +#if !RCT_DEV + return; +#endif color = [UIColor grayColor]; backgroundColor = [UIColor blackColor]; source = @"pre-bundled file";