Get Image name and date taken - nativescript-imagepicker

Refresh

6 days ago

Views

3 time

0

I am new to NativeScript-Vue. In my app I have a feature to upload images I'm using nativescript-imagepicker to do that. In iOS, How can I get the image name and when it was taken. Below is the code I'm using.

context
    .authorize()
    .then(function() {
      return context.present();
    })
    .then(selection => {
      selection.forEach(selected => {
        if (selected._android) {
          file = fileSystemModule.File.fromPath(selected._android);
          //viewModel.uploadFile(file);
        } else {
          imageSourceModule.fromAsset(selected).then(imageSource => {
            this.images.push(imageSource);
            const folder = fileSystemModule.knownFolders.documents().path;
            const fileName = "Photo.png";
            const path = fileSystemModule.path.join(folder, fileName);
            const saved = imageSource.saveToFile(path, "jpg", 60);

          });
        }
      });
    })
    .catch(function(e) {
      console.log("error in selectPicture", e);
    });

0 answers