import { PhotoLibrary } from '@awesome-cordova-plugins/photo-library/ngx';
constructor(private photoLibrary: PhotoLibrary) { }
this.photoLibrary.requestAuthorization().then(() => {
this.photoLibrary.getLibrary().subscribe({
next: library => {
library.forEach(function(libraryItem) {
console.log(libraryItem.id);
console.log(libraryItem.photoURL);
console.log(libraryItem.thumbnailURL);
console.log(libraryItem.fileName);
console.log(libraryItem.width);
console.log(libraryItem.height);
console.log(libraryItem.creationDate);
console.log(libraryItem.latitude);
console.log(libraryItem.longitude);
console.log(libraryItem.albumIds);
});
},
error: err => { console.log('could not get photos'); },
complete: () => { console.log('done getting photos'); }
});
})
.catch(err => console.log('permissions weren\'t granted'));