I choose a picture (or video) from the library of the phone, using this:
navigator.camera.getPicture(PictureSuccess, err,{
allowEdit: false,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
destinationType: Camera.DestinationType.FILE_URI,
mediaType: Camera.MediaType.ALLMEDIA
});
Then, after the picture is chosen, I do this in PictureSuccess(fileURI)
to get to the FileEntry and retrieve the file date:
window.resolveLocalFileSystemURI(fileURI, function(fileEntry) {
fileEntry.getMetadata(function(meta){
console.log(meta.modificationTime);
}, err);
}, err);
The console output is the current date instead of the the file date on iOS. On Android phones though, the output is the correct image date. I think iOS modifies the files before giving the picture to my app.
My question is: have you encountered the same problem and did you manage to find a workaround?
(using PhoneGap 2.5.0 and iOS 6.1.2)
Documentation: