From efccb5feea4491d489e4372318f7be64f1ef482c Mon Sep 17 00:00:00 2001 From: Abdurrahman SASTIM Date: Wed, 8 Jan 2025 12:30:54 +0100 Subject: [PATCH] Revert "fix :bug:(llm) ios splashscreen (#8753)" This reverts commit 0e6ee7d63d302526fc7807d3eb9241bea98c4cfa. --- .changeset/loud-masks-relate.md | 5 --- .../ios/LaunchScreen.storyboard | 6 +-- .../ios/ledgerlivemobile/AppDelegate.mm | 38 +++++++++---------- .../ios/ledgerlivemobile/Info.plist | 2 +- 4 files changed, 23 insertions(+), 28 deletions(-) delete mode 100644 .changeset/loud-masks-relate.md diff --git a/.changeset/loud-masks-relate.md b/.changeset/loud-masks-relate.md deleted file mode 100644 index 949db72fd119..000000000000 --- a/.changeset/loud-masks-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"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 59bbd39f1b8b..6a4050ab1668 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 9d7ada452a98..798fe49ee7b9 100644 --- a/apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm +++ b/apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm @@ -1,11 +1,14 @@ #import "AppDelegate.h" + #import #import #import #import "RNCConfig.h" +#import "RNSplashScreen.h" // here #import #import "BrazeReactUtils.h" #import "BrazeReactBridge.h" + #import @@ -23,18 +26,20 @@ - (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; @@ -46,7 +51,8 @@ - (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; } @@ -60,7 +66,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 @@ -70,20 +76,14 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"ledgerlivemobile" initialProperties:nil]; - - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - self.window.rootViewController = [UIViewController new]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge + moduleName:@"ledgerlivemobile" + initialProperties:nil]; [self.window makeKeyAndVisible]; - - UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]]; + UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil]; 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 eedd738eb40c..4e65bf5294d1 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 + LaunchScreen.storyboard UIRequiredDeviceCapabilities arm64