Skip to content

Commit

Permalink
remove restoring status bar style code
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Nov 4, 2023
1 parent b82ad4e commit 6204ffd
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/ios/CDVWKInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ Licensed to the Apache Software Foundation (ASF) under one

#pragma mark CDVWKInAppBrowser

@interface CDVWKInAppBrowser () {
NSInteger _previousStatusBarStyle;
}
@end

@implementation CDVWKInAppBrowser

static CDVWKInAppBrowser* instance = nil;
Expand All @@ -53,7 +48,6 @@ + (id) getInstance{
- (void)pluginInitialize
{
instance = self;
_previousStatusBarStyle = -1;
_callbackIdPattern = nil;
_beforeload = @"";
_waitForBeforeload = NO;
Expand Down Expand Up @@ -236,14 +230,6 @@ - (void)show:(CDVInvokedUrlCommand*)command withNoAnimate:(BOOL)noAnimate
NSLog(@"Tried to show IAB after it was closed.");
return;
}
if (_previousStatusBarStyle != -1) {
NSLog(@"Tried to show IAB while already shown");
return;
}

if(!initHidden){
_previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
}

__block CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
initWithRootViewController:self.inAppBrowserViewController];
Expand Down Expand Up @@ -291,17 +277,10 @@ - (void)hide:(CDVInvokedUrlCommand*)command


}
if (_previousStatusBarStyle == -1) {
NSLog(@"Tried to hide IAB while already hidden");
return;
}

_previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;

// Run later to avoid the "took a long time" log message.
dispatch_async(dispatch_get_main_queue(), ^{
if (self.inAppBrowserViewController != nil) {
self->_previousStatusBarStyle = -1;
[self.inAppBrowserViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}
});
Expand Down Expand Up @@ -640,15 +619,6 @@ - (void)browserExit
// Based on https://stackoverflow.com/questions/4544489/how-to-remove-a-uiwindow
self->tmpWindow.hidden = YES;
self->tmpWindow = nil;

if (_previousStatusBarStyle != -1) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[UIApplication sharedApplication] setStatusBarStyle:_previousStatusBarStyle];
#pragma clang diagnostic pop
}

_previousStatusBarStyle = -1; // this value was reset before reapplying it. caused statusbar to stay black on ios7
}

@end //CDVWKInAppBrowser
Expand Down

0 comments on commit 6204ffd

Please sign in to comment.