You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(iOS): Remove GCDWebServer
Removes the GCDWebServer and simplifies code. It requires iOS 11+
BREAKING CHANGE: Sets deployment-target to 11, so will only work on iOS 11+
* Address changes
Copy file name to clipboardExpand all lines: README.md
+25-53Lines changed: 25 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,9 @@
27
27
28
28
A Web View plugin for Cordova, focused on providing the highest performance experience for Ionic apps (but can be used with any Cordova app).
29
29
30
-
This plugin defaults to using WKWebView on iOS and the latest evergreen webview on Android. Additionally, this plugin makes it easy to use HTML5 style routing
31
-
that web developers expect for building single-page apps.
30
+
This plugin uses WKWebView on iOS and the latest evergreen webview on Android. Additionally, this plugin makes it easy to use HTML5 style routing that web developers expect for building single-page apps.
32
31
33
-
Note: This repo and its documentation are for `cordova-plugin-ionic-webview` @ `2.x`, which uses the new features that may not work with all apps. See [Requirements](#requirements) and [Migrating to 2.x](#migrating-to-2x).
32
+
Note: This repo and its documentation are for `cordova-plugin-ionic-webview` @ `3.x`, which uses the new features that may not work with all apps. See [Requirements](#requirements) and [Migrating to 3.x](#migrating-to-3x).
@@ -40,22 +39,28 @@ Note: This repo and its documentation are for `cordova-plugin-ionic-webview` @ `
40
39
41
40
## Configuration
42
41
43
-
This plugin has several configuration options that can be set in `config.xml`. Important: some configuration options should be adjusted for production apps, especially `WKPort`:
42
+
This plugin has several configuration options that can be set in `config.xml`.
44
43
45
-
### iOS and Android Preferences
44
+
### Android and iOS Preferences
46
45
47
-
Preferences available for both iOS and Android platforms
46
+
Preferences available for both iOS and Android
48
47
49
-
#### WKPort
48
+
#### Hostname
50
49
51
-
```xml
52
-
<preferencename="WKPort"value="8080" />
53
-
```
50
+
`<preference name="Hostname" value="app" />`
54
51
55
-
The default port the server will listen on. _You should change this to a random port number!_
52
+
Default value is `localhost`.
56
53
57
-
#### MixedContentMode
54
+
Example `ionic://app` on iOS, `http://app` on Android.
55
+
56
+
If you change it, you'll need to add a new `allow-navigation` entry in the `config.xml` for the configured url (i.e `<allow-navigation href="http://app/*"/>` if `Hostname` is set to `app`).
57
+
This is only needed for the Android url as it uses `http://`, all `ionic://` urls are whitelisted by the plugin.
58
58
59
+
### Android Preferences
60
+
61
+
Preferences only available Android platform
62
+
63
+
#### MixedContentMode
59
64
60
65
```xml
61
66
<preferencename="MixedContentMode"value="2" />
@@ -75,50 +80,13 @@ Other possible values are `1` (`MIXED_CONTENT_NEVER_ALLOW`) and `2` (`MIXED_CONT
75
80
76
81
Preferences only available for iOS platform
77
82
78
-
#### UseScheme
79
-
80
-
`<preference name="UseScheme" value="true" />`
81
-
82
-
Default value is `false`.
83
-
84
-
On iOS 11 and newer it will use a `WKURLSchemeHandler` that loads the app from `ionic://` scheme instead of using the local web server and `https://` scheme.
85
-
86
-
On iOS 10 and older will continue using the local web server even if the preference is set to `true`.
Whether to try to keep the server running when the app is backgrounded. Note: the server will likely be suspended by the OS after a few minutes. In particular, long-lived background tasks are not allowed on iOS outside of select audio and geolocation tasks.
105
-
106
-
#### WKBind
107
-
108
-
```xml
109
-
<preferencename="WKBind"value="localhost" />
110
-
```
111
-
112
-
The hostname the server will bind to. There aren't a lot of other valid options, but some prefer binding to "127.0.0.1"
Whether to restrict access to this server to the app itself. Previous versions of this plugin did not restrict access to the app itself. In 2.2.0 and above,
121
-
the plugin now restricts access to only the app itself.
89
+
Set to false to stop WKWebView suspending in background too eagerly.
122
90
123
91
#### KeyboardAppearanceDark
124
92
@@ -130,10 +98,10 @@ Whether to use a dark styled keyboard on iOS
130
98
131
99
## Plugin Requirements
132
100
133
-
***iOS**: iOS 10+ and `cordova-ios` 4+
101
+
***iOS**: iOS 11+ and `cordova-ios` 4+
134
102
***Android**: Android 4.4+ and `cordova-android` 6.4+
135
103
136
-
## Migrating to 2.x
104
+
## Migrating to 3.x
137
105
138
106
1. Remove and re-add the Web View plugin:
139
107
@@ -144,7 +112,11 @@ Whether to use a dark styled keyboard on iOS
144
112
145
113
1. Apps are now served from HTTP on Android.
146
114
147
-
* The origin for requests from the Web View is `http://localhost:8080`.
115
+
* The default origin for requests from the Android WebView is `http://localhost`. If `Hostname` preference is set, then origin will be `http://HostnameValue`.
116
+
117
+
1. Apps are now served from `ionic://` scheme on iOS.
118
+
119
+
* The default origin for requests from the iOS WebView is `ionic://localhost`. If `Hostname` preference is set, then origin will be `ionic://HostnameValue`.
148
120
149
121
1. Replace any usages of `window.Ionic.normalizeURL()` with `window.Ionic.WebView.convertFileSrc()`.
0 commit comments