The app uses cordova-ios version 6.0.0 . So all WkWebView code.
When the user selects an image using the cordova-plugin-camera plugin, and I set the returned image uri as the src of an img tag, this triggers an error, because the uri begins with file:// :
Not allowed to load local resource: file:///xxx/xxx/xxx/xxx.jpg
How is this done with wkwebview and in cordova-ios version 6, to display the selected image?
Edit: I have tried countless things and cannot make this work. I am using WkURLSchemeHandler, I set the preferences in the config.xml to be app and localhost as suggested here:
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
I see that the file:// url returned by the camera plugin is stored in the tmp folder. So I tried accessing it with app://localhost but I get 404 error:
var pos = photoURI.indexOf('/tmp');
if(pos >=0){
photoURI = 'app://localhost' + photoURI.substr(pos);
}
Any ideas will be very welcome.
Thanks.