As of August 2019, Apple is now showing a deprecation warning when uploading apps to the App Store that include UIWebView-related code. UIWebView has been unofficially deprecated in favour of the new WKWebView for a while, but Apple has now made it officially deprecated. As a result, all Cordova apps built for iOS will receive this deprecation warning on upload. Currently it is just a warning, but Apple has not provided a timeline for when it will start rejecting apps that use UIWebView APIs.
We've had a plan for several years to make it easier to migrate to WKWebView and eventually deprecate UIWebView use by Cordova, but almost no progress has been made on this objective since the plan was outlined over a year ago.
Cordova users are clamoring for a fix to the problem and there are pull requests open to remove UIWebView entirely, but if we proceed without a concrete plan then we are guaranteed to cause a lot of pain and suffering for Cordova users.
The goal of this document is to outline several potential migration plans, and facilitate discussion on the pros and cons of each.
This is probably the easiest option, but is also a very large breaking change that potentially breaks existing plugins and existing apps.
The steps are roughly:
This is a more gradual transition, closer to what had originally been announced, but runs the risk of Apple setting a rejection deadline that‘s more aggressive than what we’re able to meet.
The steps are roughly:
As above, this is easiest, but a potentially breaking change for existing apps.
Similar to above, the webview would be determined based on a config.xml preference. The UIWebView code would also need to be conditionally guarded by a compiler definition.
Steps would be:
Probably also a major breaking change, but this would be better in the long term.
An ideal scenario would be to integrate SFSafariViewController into Cordova-iOS (rather than as a plugin) and allow any URL that is not in the allow-navigation list to open in SFSafariViewController automatically. Apps would lose the ability to customize the page, but that has been a major security concern for years (particularly around OAuth login pages).
Out of scope, but if this is the decided strategy, Cordova-Android should also be updated to use Chrome Custom Tabs in the same situations, so that IAB can be deprecated for both platforms at the same time.