我是NativeScript-Vue的新手。在我的应用程序中,我具有使用nativescript-imagepicker
上传图片的功能。在iOS中,如何获取图像名称和拍摄时间。下面是我正在使用的代码。
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);
});