So we missed the proposed deadline, by a lot.
We need the community to test.
The test focus should be on plugin stability with the new platform, since it does have API changes. If downstream distribution people are on this list, this concerns your third-party plugins too.
The easiest way to test if it affects your plugin building:
cordova platform add https://github.com/apache/cordova-ios.git cordova plugin add your-plugin-id cordova build
Plugin updates and highlights:
- API changes
- 3 new private core plugins to the platform
- Plugin localized strings and resource loading
- Preferences helper functions
- WebViews as plugins. UIWebView is a private core plugin (see above). WKWebView as an installable plugin
I also want to highlight this scenario which a lot of people will encounter: CB-9592
The cordova-plugin-wkwebview-engine plugin will be iOS 9 only and it will be a core plugin. The development of this updated plugin is still in progress. Apple has fixed the bug where we couldn’t load documents from file:// urls, and it is iOS 9 only. On non-iOS 9 devices, cordova-ios will fallback to using the UIWebView.
The old version of this plugin used a local webserver to load your main document. This older plugin can be used where you want to use WKWebView in both iOS 8 and iOS 9 deployments, but the plugin will remain as a cordova-labs experiment. This plugin has some re-factoring work to be done.
Thanks for contributing!
ios-sim and ios-deploy are two tools that are used by Apache Cordova and a lot of other projects. ios-sim is used to control the iOS Simulator (and other functions) and ios-deploy is used to deploy signed apps (and other functions) to your connected iOS device.
The next major version of ios-deploy will be 2.x, and it will modularize the utility as well as provide a target to generate ios-deploy as a library. This library can then be bridged using node-ffi, so other node.js scripts can use it. See the roadmap here.
WKWebView support will be coming in cordova-ios 4.0.0, tentatively scheduled for April 2015. You can however, alpha test the support by following this README.
Pluggable webviews are coming in cordova-ios 4.0.0, which in addition to the default UIWebView, you can include the wkwebview-engine plugin for WKWebView support (it will not be in there by default so as not to break your existing code). The default uiwebview-engine has also been pluginized as well, which allows scenarios where you can update it with bug fixes after a platform release, or substituting it as the default webview for wkwebview-engine in the future.
cordova-ios 4.0.0 is still a work in a progress, and the APIs are subject to change. Rest assured that all core plugins will be compatible before we release, and we’ll test a bunch of the top plugins from plugins.cordova.io as well.
Unfortunately for the WKWebView in iOS 8, support for loading local files in the app bundle is not available (yet). The code has been patched in WebKit2, but the patch hasn’t been downstreamed into iOS yet. As of iOS 8.3 beta 2, the functionality is still not available. So, we’ve decide to use the embedded local web-server route. Because of this, the File core plugin and the Camera core plugin might not work yet (fixes are coming) — we have a solution that transforms file:/// references to the appropriate http://localhost routes.
So WKWebView is great right? Yup! But there are limitations to its behaviour as compared to UIWebView:
The full release notes are available.
Take note of the caveat that the current cordova-cli does not include this version by default until version 4.3.0 (pending Apache voting and release) so you will have to add the platform explicitly.
> node.js is required
Formerly if you did not use the cordova-cli and just used the bin/create script and the scripts in your project’s ‘cordova‘ folder, you didn’t need node.js. With this new version, all scripts have been converted from bash to node.js
NOTE: Users will need to update to ios-deploy version 1.4.0 because of this change.
> cordova bridge fix
Details here. Essentially in cordova-ios 3.7.0, a div element was (erroneously) created on every call across the bridge, which might result in a performance issue.
> handleOpenURL issues
Details here. This should work reliably now. Note that this functionality will be removed in cordova-ios 4.0.0 and be put into a plugin, which would allow more customization (including setting the callback function used).
> ability to disable push notification code
Details here. Right now all cordova-ios projects will have the entitlement warning from Apple even if they don’t actually include push notification capability. For backwards compatible reasons, this is left in for this version, but you can disable it now by adding a preprocessor macro in build.xcconfig (through a project hook).
In cordova-ios 4.0.0, this code will be removed, users can add a plugin that swizzles the appropriate AppDelegate methods instead. The AppDelegate itself in the default template will itself be cleared out, and just inherit a base class.
> emulator builds use build.xcconfig now
Details here. This is so if you want to add custom build settings to enable development and use of Swift plugins for example while testing in the Simulator (and not just the device).
iOS 8 was just released – and Cordova supports it fully, but it is still using the existing UIWebView iOS browser component (more on the new iOS 8 WKWebView later).
The main issues were in the core plugins, which have since been updated in the Cordova Plugin Registry. Update your plugins by removing and re-adding them.
If you use any of these plugins below, you will need to update these plugins and re-release your app for iOS 8, since your existing app built pre-iOS 8 may be broken in iOS 8 without these fixes.
These plugins have been updated for iOS 8:
This plugin had a fix to use the new Geolocation permissions in iOS 8. Users are now prompted whenever you require a geolocation – this is for the JPEG format EXIF data. The plugin has a new preference as well, called
CameraUsesGeolocation which defaults to
false. Previously you had no control over this, it was always
This plugin had a fix to use the new Geolocation permissions in iOS 8. Users are now prompted whenever you require a geolocation.
This plugin had a fix for pickContact — iOS 8 has added new delegate functions to handle people picking, without the fix this feature was broken in iOS 8.
Landscape mode for the StatusBar plugin was broken in iOS 8, and the updated plugin fixes it. This is because on iOS 8, screen size is now orientation dependent — previously it was based off portrait mode. The
StatusBarBackgroundColor preference is now omitted as well when you install the plugin, leaving it effectively transparent (was #000000 or black). You will have to now set it explicitly.
For whatever reason you are using this, realize that it is broken currently (same reason as the StatusBar landscape fix). If your plugin is not using this macro, don’t worry about it. It has already been fixed for 3.7.0.
If you are using the Web Inspector, you might see “deprecated attempt to access property” errors that are harmless. It has already been fixed for 3.7.0.
Unfortunately there is a serious bug in WKWebView where it can’t load file:// urls, so it has hampered our efforts. This functionality was working in iOS 8 betas 1 to 3 on the device (it always works in the iOS 8 Simulator), but broken after that. I’m not sure what the ETA for the bug fix is, but it is in Apple’s radar (literally!).
In the meantime, we have some ideas, like running a local webserver to load the local assets. More info and discussion here.
For all the issues related to Cordova iOS and iOS 8, including our work in getting WKWebView support, check out this task list.
The plugin interfaces below will be deprecated in Apache Cordova 3.6.0 (iOS), and will be removed totally in the major release of 4.0.0 later this year. Please plan accordingly if you have plugins that use these interfaces.
If you followed the 3.x Guides on how to create and use plugins, you should be OK, these interfaces have been there pre-3.x and were documented in the 2.x stream, but not in the 3.x stream. If you need to upgrade, consult the docs for the new methods.
- (NSString*)toJSONString; - (NSString*)toSuccessCallbackString:(NSString*)callbackId; - (NSString*)toErrorCallbackString:(NSString*)callbackId;
Beginning today – the PhoneGap Facebook Plugin has a new home under Wizcorp. Ally Ogilvie of Wizcorp has been doing a great job of maintaining this plugin thus far, and his excellent stewardship of the plugin will continue on. Read his blog post on this.
Please update your bookmarks and point your git urls to the new location when adding a plugin using the CLI.