From 0e6ee7d63d302526fc7807d3eb9241bea98c4cfa Mon Sep 17 00:00:00 2001 From: Lucas Werey <73439207+LucasWerey@users.noreply.github.com> Date: Tue, 24 Dec 2024 17:01:03 +0100 Subject: [PATCH] fix :bug:(llm) ios splashscreen (#8753) --- .changeset/loud-masks-relate.md | 5 +++ .../ios/LaunchScreen.storyboard | 6 +-- .../ios/ledgerlivemobile/AppDelegate.mm | 38 +++++++++---------- .../ios/ledgerlivemobile/Info.plist | 2 +- 4 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 .changeset/loud-masks-relate.md diff --git a/.changeset/loud-masks-relate.md b/.changeset/loud-masks-relate.md new file mode 100644 index 000000000000..949db72fd119 --- /dev/null +++ b/.changeset/loud-masks-relate.md @@ -0,0 +1,5 @@ +--- +"live-mobile": minor +--- + +Restore IOS launchscreen diff --git a/apps/ledger-live-mobile/ios/LaunchScreen.storyboard b/apps/ledger-live-mobile/ios/LaunchScreen.storyboard index 6a4050ab1668..59bbd39f1b8b 100644 --- a/apps/ledger-live-mobile/ios/LaunchScreen.storyboard +++ b/apps/ledger-live-mobile/ios/LaunchScreen.storyboard @@ -1,9 +1,9 @@ - + - + @@ -11,7 +11,7 @@ - + diff --git a/apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm b/apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm index 798fe49ee7b9..9d7ada452a98 100644 --- a/apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm +++ b/apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm @@ -1,14 +1,11 @@ #import "AppDelegate.h" - #import #import #import #import "RNCConfig.h" -#import "RNSplashScreen.h" // here #import #import "BrazeReactUtils.h" #import "BrazeReactBridge.h" - #import @@ -26,20 +23,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Retrieve the correct GoogleService-Info.plist file name for a given environment NSString *googleServiceInfoEnvName = [RNCConfig envFor:@"GOOGLE_SERVICE_INFO_NAME"]; NSString *googleServiceInfoName = googleServiceInfoEnvName; - if ([googleServiceInfoName length] == 0) { googleServiceInfoName = @"GoogleService-Info"; } - + // Initialize Firebase with the correct GoogleService-Info.plist file NSString *filePath = [[NSBundle mainBundle] pathForResource:googleServiceInfoName ofType:@"plist"]; FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; [FIRApp configureWithOptions:options]; - + // Setup Braze NSString *brazeApiKeyFromEnv = [RNCConfig envFor:@"BRAZE_IOS_API_KEY"]; NSString *brazeCustomEndpointFromEnv = [RNCConfig envFor:@"BRAZE_CUSTOM_ENDPOINT"]; - BRZConfiguration *configuration = [[BRZConfiguration alloc] initWithApiKey:brazeApiKeyFromEnv endpoint:brazeCustomEndpointFromEnv]; configuration.triggerMinimumTimeInterval = 1; configuration.logger.level = BRZLoggerLevelInfo; @@ -51,8 +46,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } if (pushAutoEnabled) { NSLog(@"iOS Push Auto enabled."); - configuration.push.automation = - [[BRZConfigurationPushAutomation alloc] initEnablingAllAutomations:YES]; + configuration.push.automation = [[BRZConfigurationPushAutomation alloc] initEnablingAllAutomations:YES]; configuration.push.automation.requestAuthorizationAtLaunch = NO; } @@ -66,7 +60,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } [[BrazeReactUtils sharedInstance] populateInitialUrlFromLaunchOptions:launchOptions]; - + BOOL appLaunched = [super application:application didFinishLaunchingWithOptions:launchOptions]; // This condition is needed to prevent a crash since upgrading to React Native 0.75.4 // It may be fixed in a later version of React Native @@ -76,14 +70,20 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge - moduleName:@"ledgerlivemobile" - initialProperties:nil]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"ledgerlivemobile" initialProperties:nil]; + + + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + self.window.rootViewController = [UIViewController new]; [self.window makeKeyAndVisible]; - UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil]; + + UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]]; UIViewController *vc = [sb instantiateInitialViewController]; + rootView.loadingView = vc.view; - + + + self.window.rootViewController.view = rootView; return YES; } @@ -152,23 +152,23 @@ - (void) showOverlay{ blurEffectView.frame = [self.window bounds]; blurEffectView.tag = 12345; logoView.tag = 12346; - + blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.window addSubview:blurEffectView]; [self.window addSubview:logoView]; [self.window bringSubviewToFront:logoView]; - + [logoView setContentHuggingPriority:251 forAxis:UILayoutConstraintAxisHorizontal]; [logoView setContentHuggingPriority:251 forAxis:UILayoutConstraintAxisVertical]; logoView.frame = CGRectMake(0, 0, 128, 128); - + logoView.center = CGPointMake(self.window.frame.size.width / 2,self.window.frame.size.height / 2); } - (void) hideOverlay{ UIView *blurEffectView = [self.window viewWithTag:12345]; UIView *logoView = [self.window viewWithTag:12346]; - + [UIView animateWithDuration:0.5 animations:^{ blurEffectView.alpha = 0; logoView.alpha = 0; diff --git a/apps/ledger-live-mobile/ios/ledgerlivemobile/Info.plist b/apps/ledger-live-mobile/ios/ledgerlivemobile/Info.plist index 4e65bf5294d1..eedd738eb40c 100644 --- a/apps/ledger-live-mobile/ios/ledgerlivemobile/Info.plist +++ b/apps/ledger-live-mobile/ios/ledgerlivemobile/Info.plist @@ -118,7 +118,7 @@ remote-notification UILaunchStoryboardName - LaunchScreen.storyboard + LaunchScreen UIRequiredDeviceCapabilities arm64