Skip to content

Commit

Permalink
Revert "fix 🐛(llm) ios splashscreen (#8753)"
Browse files Browse the repository at this point in the history
This reverts commit 0e6ee7d.
  • Loading branch information
abdurrahman-ledger committed Jan 8, 2025
1 parent 35a0738 commit efccb5f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 28 deletions.
5 changes: 0 additions & 5 deletions .changeset/loud-masks-relate.md

This file was deleted.

6 changes: 3 additions & 3 deletions apps/ledger-live-mobile/ios/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController useStoryboardIdentifierAsRestorationIdentifier="YES" id="Y6W-OH-hqX" sceneMemberID="viewController">
<viewController id="Y6W-OH-hqX" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down
38 changes: 19 additions & 19 deletions apps/ledger-live-mobile/ios/ledgerlivemobile/AppDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>
#import <React/RCTRootView.h>
#import "RNCConfig.h"
#import "RNSplashScreen.h" // here
#import <BrazeKit/BrazeKit-Swift.h>
#import "BrazeReactUtils.h"
#import "BrazeReactBridge.h"

#import <Firebase.h>


Expand All @@ -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;
Expand All @@ -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;
}

Expand All @@ -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
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/ios/ledgerlivemobile/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<string>LaunchScreen.storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
Expand Down

0 comments on commit efccb5f

Please sign in to comment.