cordova-plugin-photo-library icon indicating copy to clipboard operation
cordova-plugin-photo-library copied to clipboard

It doesn't list images from same albums

Open brunofrank opened this issue 7 years ago • 2 comments
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'));

brunofrank avatar Jul 20 '18 18:07 brunofrank

I have same problem. Any ideas?

vista-54 avatar Sep 22 '18 19:09 vista-54

Any update on this.

oseintow avatar Apr 11 '19 20:04 oseintow