Recently, Apple introduced a new App Submission warning stating that they are formally deprecating UIWebView. We wanted to let the Ionic community know what this warning is all about and how the Ionic team plans to address it.

Update 01/15/2020: On December 23rd, 2019, Apple clarified plans for UIWebView: “The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.” Please follow the instructions below to either update to a newer version of Cordova or migrate to Capacitor.

Update 11/25/2019: The Cordova team has released Cordova iOS 5.1.0, which disables UIWebview at compile time. To use it, ensure you have a WKWebView plugin installed, then add <preference name="WKWebViewOnly" value="true" /> to your config.xml file. Complete details below.

The bottom line: It’s time to update your apps! Apple will only accept submissions of Ionic-based iOS apps that contain references to UIWebView until April 2020 (new apps) and December 2020 (existing apps). To meet the new requirement, simply update to the latest version of Capacitor. If you’re using Cordova, see below.

What is this about?

A WebView is an embeddable web browser that native applications can use to display web content. Used by native runtimes like Cordova and Capacitor, they are part of the secret sauce that Ionic developers use to package web-based apps into native mobile apps that can access native hardware features like the camera or Bluetooth.

Apple previously announced UIWebView’s deprecation in June 2018. Beginning with iOS 12, they began warning developers about migrating to WKWebView, UIWebView’s successor.

This recent notification has brought it to the forefront. For reference, here’s the message you’ll see if you upload an app binary to the App Store:

We identified one or more issues with a recent delivery for your app, [App Name & version number]. Your delivery was successful, but you may wish to correct the following issues in your next delivery:

ITMS-90809: Deprecated API Usage – Apple will stop accepting submissions of apps that use UIWebView APIs. See https://developer.apple.com/documentation/uikit/uiwebview for more information.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to App Store Connect.

What’s the issue?

When you build an Ionic app, you can choose between Cordova or Capacitor to deploy a native mobile version. While more recent versions use WKWebView automatically, Cordova still uses UIWebView APIs outright or contain references to them (Capacitor has been updated to remove these references – see below).

Upon app submission, Apple searches the app’s code for the “UIWebView” string then generates a submission warning if found. Therefore, a future release of cordova-ios (the Cordova iOS library) will be required to ensure that all references to UIWebView APIs removed.

Will this prevent me from releasing an Ionic-based iOS app?

Yes, unless you update your app by these deadlines:
* April 2020: New apps
* December 2020: Existing apps

Currently, no, since this is just a warning, not an error. Warnings will not result in App Store rejections. UIWebView APIs are still supported in the upcoming iOS 13 release as well as macOS Catalina but are still going away in future releases.

Sometime in the future, iOS apps may be blocked from release to the App Store when Apple decides to enforce blocking apps that use UIWebView.

What is Ionic doing about it?

On December 23rd, 2019, Apple released a news article detailing their plans.

We have asked Apple for the official date that they will stop accepting app submissions that include UIWebView APIs, but have not heard back yet. We will update this blog when we know more information.

Using Cordova?

On November 25th, 2019, the Cordova team released Cordova iOS 5.1.0, which disables UIWebview at compile time. They were previously discussing a plan to move forward.

To update:

  • Ensure you have a WKWebView plugin installed: either the official Apache one or Ionic’s. All Ionic starter apps automatically include cordova-plugin-ionic-webview.
  • Add <preference name="WKWebViewOnly" value="true" /> to your config.xml file.
  • Run cordova prepare ios to apply the changes.

To recap:

  • 5.1.0 has a conditional compile-time flag that disables UIWebView. This is an initial fix to prevent the Apple warning from being triggered.
  • 6.0.0 will remove the entirety of UIWebView. This is a breaking change with more changes needed, so it’ll be released sometime in the coming months. As of January 2020, no ETA for release is known but version 5.1.0 will work just fine.

Using the popular InAppBrowser plugin? The Cordova team released an update in January 2020. Be sure to update this plugin to version 3.2.0 and above.

Using Capacitor?

With this deprecation notice, now is the perfect time to consider migrating to Capacitor, Ionic’s spiritual successor to Cordova that enables modern web apps to run on all major platforms with ease.

On September 4th, 2019, the Ionic team shipped a new Capacitor release (here’s the v1.2.0 changelog) that removed references to UIWebView. To update your app, simply run the following commands to update the Capacitor iOS library:

npm update @capacitor/cli
npm update @capacitor/core
npm update @capacitor/ios
npx cap sync

Please note that if you’re using Cordova plugins in your Capacitor project, you’ll need to ensure those are updated eventually.

Customers using Ionic Native Enterprise Edition plugins, including the popular InAppBrowser plugin can update now as well. If your team relies on a particular native plugin, please reach out to us for assistance. If you’re on an Ionic Native Enterprise plan, please contact Ionic Support if you have any questions.

Signup for the Ionic Newsletter to get the latest news and updates!