Skip to content

Commit aac3b6b

Browse files
committed
update fix for iOS 12
1 parent ca592f3 commit aac3b6b

File tree

15 files changed

+9
-78
lines changed

15 files changed

+9
-78
lines changed

merges/ios/scripts/mobile.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,6 @@ document.addEventListener('deviceready', onDeviceReady, false);
2222

2323
function onDeviceReady() {
2424
StatusBar.hide();
25-
26-
// fix an issue with iOS 12 (@see https://github.com/apache/cordova-ios/issues/417#issuecomment-466520675)
27-
function ios12NotchFix(is_ios, keyboard_plugin_exists) {
28-
if (!is_ios || device.model.indexOf("iPhone") === -1) return false;
29-
if (!keyboard_plugin_exists) throw new Error("This fix depends on 'cordova-plugin-keyboard'!");
30-
const iphone_number = Number(device.model.replace("iPhone", "").replace(",", "."));
31-
const /* viewport metatag */
32-
viewport_el = document.getElementsByName("viewport")[0],
33-
default_content = "user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1";
34-
35-
if (iphone_number >= 10.6 || iphone_number === 10.3) { /* devices with notch: X, XR, ... */
36-
setCover();
37-
38-
window.addEventListener('keyboardWillShow', setFix);
39-
window.addEventListener('keyboardWillHide', setCover);
40-
}
41-
function setCover() { viewport_el.content = default_content + ", viewport-fit=cover"; }
42-
function setFix() { viewport_el.content = default_content; }
43-
}
44-
45-
ios12NotchFix(device.platform === "iOS", typeof Keyboard !== "undefined");
4625
}
4726

4827
document.addEventListener('menubutton', onMenuButton, false);

package-lock.json

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@
1212
"cordova-plugin-whitelist": {},
1313
"cordova-plugin-wkwebview-engine": {},
1414
"cordova-plugin-inappbrowser": {},
15-
"cordova-plugin-statusbar": {},
16-
"cordova-plugin-keyboard": {},
17-
"cordova-plugin-device": {}
15+
"cordova-plugin-statusbar": {}
1816
}
1917
},
2018
"dependencies": {
2119
"cordova-android": "8.0.0",
2220
"cordova-browser": "6.0.0",
2321
"cordova-ios": "5.0.0",
24-
"cordova-plugin-device": "2.0.2",
2522
"cordova-plugin-inappbrowser": "3.0.0",
26-
"cordova-plugin-keyboard": "1.2.0",
2723
"cordova-plugin-statusbar": "2.4.2",
2824
"cordova-plugin-whitelist": "1.3.3",
2925
"cordova-plugin-wkwebview-engine": "1.1.4"

plugins/android.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
},
1919
"cordova-plugin-wkwebview-engine": {
2020
"PACKAGE_NAME": "com.ecarriou.systemdesignerios"
21-
},
22-
"cordova-plugin-keyboard": {
23-
"PACKAGE_NAME": "com.ecarriou.systemdesignerios"
24-
},
25-
"cordova-plugin-device": {
26-
"PACKAGE_NAME": "com.ecarriou.systemdesignerios"
2721
}
2822
},
2923
"dependent_plugins": {}

plugins/browser.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@
77
"files": {}
88
},
99
"installed_plugins": {
10-
"cordova-plugin-device": {
11-
"PACKAGE_NAME": "io.cordova.hellocordova"
12-
},
1310
"cordova-plugin-inappbrowser": {
1411
"PACKAGE_NAME": "io.cordova.hellocordova"
1512
},
16-
"cordova-plugin-keyboard": {
17-
"PACKAGE_NAME": "io.cordova.hellocordova"
18-
},
1913
"cordova-plugin-statusbar": {
2014
"PACKAGE_NAME": "io.cordova.hellocordova"
2115
},

plugins/fetch.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,5 @@
3030
},
3131
"is_top_level": true,
3232
"variables": {}
33-
},
34-
"cordova-plugin-keyboard": {
35-
"source": {
36-
"type": "registry",
37-
"id": "cordova-plugin-keyboard@latest"
38-
},
39-
"is_top_level": true,
40-
"variables": {}
41-
},
42-
"cordova-plugin-device": {
43-
"source": {
44-
"type": "registry",
45-
"id": "cordova-plugin-device"
46-
},
47-
"is_top_level": true,
48-
"variables": {}
4933
}
5034
}

plugins/ios.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@
77
"files": {}
88
},
99
"installed_plugins": {
10-
"cordova-plugin-device": {
11-
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
12-
},
1310
"cordova-plugin-inappbrowser": {
1411
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
1512
},
16-
"cordova-plugin-keyboard": {
17-
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
18-
},
1913
"cordova-plugin-statusbar": {
2014
"PACKAGE_NAME": "$(PRODUCT_BUNDLE_IDENTIFIER)"
2115
},

www/app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<title>Loading...</title>
66
<meta charset="UTF-8">
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover">
88
</head>
99

1010
<body>

www/behavior.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="description" content="An IDE for designing systems">
8-
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
8+
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover' name='viewport' />
99
<title>behavior · system </title>
1010
<!-- bootstrap -->
1111
<link href="lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

www/component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="description" content="An IDE for designing systems">
8-
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
8+
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover' name='viewport' />
99
<title>component · system </title>
1010
<!-- bootstrap -->
1111
<link href="lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

0 commit comments

Comments
 (0)