refactor(ios)!: Drop support of iOS 10 and older (#255)

This commit is contained in:
jcesarmobile 2023-04-25 00:01:51 +02:00 committed by GitHub
parent d4dcd713f1
commit 78e5992543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 16 deletions

View File

@ -30,7 +30,8 @@
}, },
"4.0.0": { "4.0.0": {
"cordova-android": ">=10.0.0", "cordova-android": ">=10.0.0",
"cordova": ">=3.0.0" "cordova": ">=3.0.0",
"cordova-ios": ">=6.0.0"
}, },
"5.0.0": { "5.0.0": {
"cordova": ">100" "cordova": ">100"

View File

@ -30,6 +30,7 @@
<engines> <engines>
<engine name="cordova" version=">=3.0.0" /> <engine name="cordova" version=">=3.0.0" />
<engine name="cordova-android" version=">=10.0.0" /> <engine name="cordova-android" version=">=10.0.0" />
<engine name="cordova-ios" version=">=6.0.0" />
</engines> </engines>
<js-module src="www/statusbar.js" name="statusbar"> <js-module src="www/statusbar.js" name="statusbar">

View File

@ -428,8 +428,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
-(void)resizeWebView -(void)resizeWebView
{ {
BOOL isIOS11 = (IsAtLeastiOSVersion(@"11.0"));
CGRect bounds = [self.viewController.view.window bounds]; CGRect bounds = [self.viewController.view.window bounds];
if (CGRectEqualToRect(bounds, CGRectZero)) { if (CGRectEqualToRect(bounds, CGRectZero)) {
bounds = [[UIScreen mainScreen] bounds]; bounds = [[UIScreen mainScreen] bounds];
@ -446,19 +444,12 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
if (!self.statusBarOverlaysWebView) { if (!self.statusBarOverlaysWebView) {
frame.origin.y = height; frame.origin.y = height;
} else { } else {
frame.origin.y = height >= 20 ? height - 20 : 0; float safeAreaTop = self.webView.safeAreaInsets.top;
if (isIOS11) { if (height >= safeAreaTop && safeAreaTop >0) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 // Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
if (@available(iOS 11.0, *)) { frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
float safeAreaTop = self.webView.safeAreaInsets.top; } else {
if (height >= safeAreaTop && safeAreaTop >0) { frame.origin.y = 0;
// Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
} else {
frame.origin.y = 0;
}
}
#endif
} }
} }
frame.size.height -= frame.origin.y; frame.size.height -= frame.origin.y;