You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modifying the example code to this fixes the error for me:
this.photo.requestAuthorization({read: true}).then(()=>{this.photo.getLibrary().subscribe({next: (lib: any)=>{lib.library.forEach(function(libraryItem){console.log(libraryItem.id);// ID of the photoconsole.log(libraryItem.photoURL);// Cross-platform access to photoconsole.log(libraryItem.thumbnailURL);// Cross-platform access to thumbnailconsole.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);// array of ids of appropriate AlbumItem, only of includeAlbumsData was used});},error: err=>{console.log('could not get photos');},complete: ()=>{console.log('done getting photos');}});})
Additionally you could create a new interface which matches the object that getLibrary() returns and cast it to that. The any cast is just quick and dirty.
The example on the official website has an error
http://www.ionic.wang/native_doc-index-id-231.html
The text was updated successfully, but these errors were encountered: