What is the different between FILE_URI and NATIVE_URI in cordova plugin camera?
There are three options, and from what I understand they are different per platform:
Camera.DestinationType.FILE_URI
'file://' ios
'content://' android
Camera.DestinationType.NATIVE_URI
'assets-library://' ios
'content://' android
Camera.DestinationType.DATA_URL
'data:image/jpg;base64,'
If you want to convert them to other urls you can use the file plugin: https://github.com/apache/cordova-plugin-file
navigator.camera.getPicture(function (path) {
window.alert('getPicture.success: ' + JSON.stringify(path));
window.resolveLocalFileSystemURI(path, function (fileEntry) {
window.alert("success: " + JSON.stringify(fileEntry));
}, function (e) {
window.alert("error: " + JSON.stringify(e));
});
}, function (e) {
window.alert('getPicture.error: ' + JSON.stringify(e));
}, $scope.options);
Here is the documentation for the options: https://github.com/apache/cordova-plugin-camera/blob/master/www/CameraConstants.js
And also the link to the source code for this function: https://github.com/apache/cordova-plugin-file/blob/master/www/resolveLocalFileSystemURI.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With