terikon / cordova-plugin-photo-library

Maintainer needed. Please contact if you're using this library in your project
MIT License
149 stars 296 forks source link

Doesn't get anything on iOS #35

Closed kartagis closed 7 years ago

kartagis commented 7 years ago

Hello, Although the code at https://jsfiddle.net/kartagis/pjdqp3ku/6/ loads up the images instantly on Android, it stalls at ActivityIndicator.show()on iOS, resulting in not showing any images.

viskin commented 7 years ago

Should be permission issue. If a call to getLibrary returns permission error, you should call requestAuthorization. Something like this:

cordova.plugins.photoLibrary.getLibrary(
  function (library) { },
  function (err) {
    if (err.startsWith('Permission')) {
      // call requestAuthorization, and retry
    }
    // Handle error - it's not permission-related
  }
);
kartagis commented 7 years ago

Isn't this what --variable PHOTOLIBRARY_USAGE_DESCRIPTION='' does?

On 26 January 2017 at 11:08, viskin notifications@github.com wrote:

Should be permission issue. If a call to getLibrary returns permission error, you should call requestAuthorization. Something like this:

cordova.plugins.photoLibrary.getLibrary( function (library) { }, function (err) { if (err.startsWith('Permission')) { // call requestAuthorization, and retry } // Handle error - it's not permission-related } );

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/terikon/cordova-plugin-photo-library/issues/35#issuecomment-275329291, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiHXnBXcuREdzPPNMtxopao1i0fkxgVks5rWFR-gaJpZM4LtQDV .

--

cozzbie commented 7 years ago

@kartagis all that does is set the message that will be shown on permission prompt. I havent tried this plugin yet but I think @viskin is right. Try querying for permission again.

kartagis commented 7 years ago

@viskin @cozzbie aye, it was permission issue. After I use requestAuthorization, how do retry reading the library? getLibrary again?

kartagis commented 7 years ago

I tried requestAuthorization, and called getLibrary in the callback, but it's way too slow on iOS. 19204ms to be precise (if not more).

viskin commented 7 years ago

Wow, 20sec...

  1. Is it time getLibrary method runs, or also retrieving thumbnails?
  2. How many photos are on your device?
kartagis commented 7 years ago

1- It's only the time getLibrary runs 2- There are 1185 photos on my device

On Fri, 27 Jan 2017 at 21:29, viskin notifications@github.com wrote:

Wow, 20sec...

  1. Is it time getLibrary method runs, or also retrieving thumbnails?
  2. How many photos are on your device?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terikon/cordova-plugin-photo-library/issues/35#issuecomment-275737959, or mute the thread https://github.com/notifications/unsubscribe-auth/ABiHXiIOHn4NFNe7yBr3DPhMw4sdmw4Kks5rWjedgaJpZM4LtQDV .

--

kartagis commented 7 years ago

Moving to the other issue, as this is no more relevant