I'm building a PhoneGap 1.5 (Cordova) application for iOS and want to use the ChildBrowser plugin to show PDF files. I've been able to get it set up and it works very well when I'm viewing external PDF files (http, https).
The app has limited offline capabilities. I'm using the file system and file transfer API to download PDF files and save them to the local file system. When I try to view these documents using the ChildBrowser plugin, they never load.
I've done some troubleshooting by sticking some breakpoints in the plugin's command and viewcontroller. I find when I try to view a local document, I hit the webViewDidFailLoadWithError method with the following message:
The operation couldn't be completed.
(WebKitErrorDomain error 101.)
The console shows the file:// URL of the document I tried to load, and if I browse that URL in safari on the simulator, I am able to view the document. The URL is similar to this when run in the simulator:
file://localhost/Users/{username}/Library/Application Support/iPhone Simulator/5.1/Applications/5D8EDAB7-4BB7-409E-989D-250A84B37877/Documents/{filename}
Is what I'm doing possible, and if so, how do I need to configure my application to be able to show PDF files from the local file system in the ChildBrowser?