Updating Your iOS App Built With Cordova To Use WKWebView API

Radiant Media Player Blog

Last updated on March 24, 2020 - Back to blog home page

Apple News

On December 23, 2019 Apple announced on its developer website that it will remove support for the UIWebView API by end 2020:

The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.

Since the release of that news, iOS app developers have received warning from Apple when submitting Cordova-based app to the App Store that references the UIWebView API:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs.

Hopefully a straightforward solution exists: update from UIWebView API to WKWebView API.

This news affects all users of hybrid web-to-native frameworks like Cordova or Ionic and invites app developers to update existing apps and review their approach for new app development. Since Radiant Media Player strategy to support apps for iOS is based on the usage of hybrid web-to-native frameworks, we are publishing this blog post to help our customers get up to speed rapidly with this change.

This news is of benefits to your viewers and a good news for hybrid web-to-native app development. The WKWebView API provides better security and reliability, including for the use of HTML5 video or audio in a hybrid web-to-native iOS app. Do not listen to the anti-hybrid-framework evangelists that will tell you that this is the end of web-to-native apps on the Apple App Store - this change just pushes forward a new WebView interface that works better on Apple devices.

Update for Cordova-based iOS apps

Those steps are valid as of March 24, 2020. Taking those steps should get you in the clear with app submission to the Apple App Store with regards to the discontinuity of UIWebView API support.

  • Required: use a WKWebView plugin for your Cordova project - we recommend using latest version of cordova-plugin-wkwebview-engine - 1.2.1 as of writing this blog post
  • Update to cordova-ios@5.1.1 or higher
  • Add preference flag WKWebViewOnly to the config.xml

Example config.xml with cordova-plugin-wkwebview-engine plugin:

<platform name="ios">
  <preference name="WKWebViewOnly" value="true" />
  <feature name="CDVWKWebViewEngine">
    <param name="ios-package" value="CDVWKWebViewEngine" />
  </feature>
  <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
</platform>

What if I still get a warning from Apple after the update to WKWebView API?

If you are still getting a warning from Apple after the above steps, most likely another Cordova plugin that you are using still references UIWebView. You will need to identify which plugin and contact the plugin developers to request a fix.

Update for Ionic-based iOS apps

With Ionic you can either use Cordova or Capacitor as an underlying engine for web-to-native transpiling. The Ionic developer team has released a complete article on how to best handle the update to WKWebView API.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2024 Radiant Media Player. All Rights Reserved.