cordova-plugin-photo-library
cordova-plugin-photo-library copied to clipboard
It doesn't list images from same albums
trafficstars
Hey guys,
When I list the albums I got all albums on my device, but when I call getLibraryit doesn't bring images inside some albums, or maybe it doesn't link the photo with the right album.
this.photoLibrary.requestAuthorization().then(() => {
this.photoLibrary.getAlbums().then(albums => {
const albumId = albums.filter(album => album.title.toLowerCase() === 'screenshots')[0].id;
console.log("Screenshots", albumId);
this.photoLibrary.getLibrary({ includeAlbumData: true, quality: 1.0 }).subscribe({
next: library => {
library.filter(libraryItem => libraryItem.albumIds.indexOf(albumId) >= 0).forEach(i => {
console.log('ID', i.id);
console.log('FILE', i.fileName);
console.log('ALBUM', i.albumIds);
});
},
error: err => { console.log('could not get photos'); },
complete: () => { console.log('done getting photos'); }
});
});
}).catch(err => console.log('permissions weren\'t granted'));
I have same problem. Any ideas?
Any update on this.