Skip to content

Commit

Permalink
🐛(llm) fix splashscreen (#8382)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey authored Nov 18, 2024
1 parent f0a2488 commit eda2042
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-files-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

Fix splashscreen on launch
4 changes: 2 additions & 2 deletions apps/ledger-live-mobile/ios/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
26 changes: 12 additions & 14 deletions apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"ledgerlivemobile"
Expand All @@ -32,16 +32,16 @@ - (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"];
Expand Down Expand Up @@ -72,14 +72,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}

[[BrazeReactUtils sharedInstance] populateInitialUrlFromLaunchOptions:launchOptions];

[self.window makeKeyAndVisible];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
UIViewController *vc = [sb instantiateInitialViewController];
rootView.loadingView = vc.view;


[super application:application didFinishLaunchingWithOptions:launchOptions];

[RNSplashScreen show];

return YES;
}

Expand Down Expand Up @@ -147,23 +145,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;
Expand Down

0 comments on commit eda2042

Please sign in to comment.