Hybrid mobile apps might benefit from access to a new API on iOS 8, but that API is currently affected by a serious bug.
Apple paved the way for better-performing hybrid apps on the iPhone and iPad by introducing the WKWebView API in iOS 8 earlier this year.
The WKWebView API is significant as it lets hybrid apps running on iOS 8 take advantage of the same optimisations as the Safari web browser, allowing for about a 20 percent performance boost over apps using the old UIWebView API.
However, developers hoping to exploit this new API will need to work around a bug that breaks a common way for loading local files from the device.
The bug, present since iOS beta 4, prevents apps using the WKWebView from loading a file with the file://URL protocol.
This flaw means the app will not load a file URL from the app's sandbox as expected, affecting non-HTML files stored in Documents, Library, Library/Caches, tmp and app bundle.
The fault may not be immediately obvious as while the protocol works for loading files on the iOS 8 simulator used to test apps, it doesn't work on actual iOS 8 devices.
A bug report has been filed via Open Radar and remains open at the time this article was published.
What's being done to fix it?
Given the bug has been present since iOS beta 4 and Apple hasn't commented, third-party developers have been looking at workarounds to allow hybrid apps to load local assets.
Developers working on the Apache Cordova framework, which simplifies the creation of hybrid apps on smartphones and is the basis for the widely-used PhoneGap, are looking at creating a plugin to load files using a local webserver.
On the Cordova mailing list developer Shazron Abdullah discusses creating the plugin using Apple-licensed code for creating a very simple HTTP service for the Cocoa framework.
Even though the code is now classed as being a retired document, Abdullah says, "It's perfectly good code", and points to other apps that use local webservers.
Apple has yet to respond to a request for comment.