You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2020/03/18 09:09:20 UTC

[cordova-docs] branch master updated: Add howto for WKWebViewOnly (#1066)

This is an automated email from the ASF dual-hosted git repository.

niklasmerz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new c8e704c  Add howto for WKWebViewOnly (#1066)
c8e704c is described below

commit c8e704c0d55243676a0710bba15660d56b40babc
Author: Niklas Merz <ni...@apache.org>
AuthorDate: Wed Mar 18 10:09:03 2020 +0100

    Add howto for WKWebViewOnly (#1066)
    
    Co-Authored-By: エリス <er...@users.noreply.github.com>
---
 www/_posts/2020-03-18-wkwebviewonly.md | 56 ++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/www/_posts/2020-03-18-wkwebviewonly.md b/www/_posts/2020-03-18-wkwebviewonly.md
new file mode 100644
index 0000000..8eb0af1
--- /dev/null
+++ b/www/_posts/2020-03-18-wkwebviewonly.md
@@ -0,0 +1,56 @@
+---
+layout: post
+author:
+    name: Niklas Merz
+    url: https://twitter.com/niklasmaerz
+title:  "How To Use 'WKWebViewOnly'"
+categories: howto
+tags: ios
+---
+
+Apple started to reject apps with `UIWebView` references. You will need to update your app to fix this and this post sums up the required steps.
+
+This should solve the warning after uploading the app to App Store connect:
+
+> ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs.
+
+A new `preference` flag `WKWebViewOnly` was introduced to remove all `UIWebView` references from Cordova's code during compile-time. It is recommended to upgrade the `cordova-ios` platform to version `5.1.1`.
+
+<!--more-->
+
+## Use a WKWebView plugin.
+
+The following example uses the `[cordova-plugin-wkwebview-engine](https://github.com/apache/cordova-plugin-wkwebview-engine)` plugin:
+
+* Add plugin `cordova-plugin-wkwebview-engine`, preferably the latest version **1.2.1**
+* Add `preference` attribute `CordovaWebViewEngine` to the `config.xml`.
+* Add `feature` attribute `CDVWKWebViewEngine` to the `config.xml`.
+* Add `preference` `WKWebViewOnly` to the `config.xml`.
+
+**Example `config.xml` with `cordova-plugin-wkwebview-engine` plugin**
+
+```xml
+<platform name="ios">
+    <preference name="WKWebViewOnly" value="true" />
+
+    <feature name="CDVWKWebViewEngine">
+        <param name="ios-package" value="CDVWKWebViewEngine" />
+    </feature>
+
+    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
+</platform>
+```
+
+## Still getting the warning?
+
+If you are still getting the warning, it is most likely one or more plugins in your project are still references `UIWebView`. You will need to identify which plugins and contact those plugin's developers through their support channel (plugin's repo). They will need to fix their plugins by either remove the references or wrap them with the new flag.
+
+## Using other WKWebView plugin
+
+There are alternatives to the official WKWebView plugin from the examples above. Make sure they have been updated and use the latest version. If you have any issues or usage questions with their plugins, please read their docs and request help through their support channels.
+
+## Future Roadmap
+
+The next major release of `cordova-ios` will remove all references of `UIWebView` from code. The flag will also be removed in the next major release as `WKWebView` will be Cordova's default webview. There is currently *no ETA* for the next major release.
+
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org