All Phone Contacts Asyncronously

I’d like to fetch all the contacts on the phone, but for normal number of contacts (4000) it blocks the UI thread for 20 seconds when I call do:

  var options = {
    filter: '',
    multiple: true,
    // Something has to go here, but I'm not filtering so it doesn't matter
    fields: ['displayName']

  return $cordovaContacts.find(options);

Even if I don’t wait for the promise, the UI is still unresponsive while this method is running. What can I do? I tried using Web Workers but that was a disaster are you can see here: Ionic in Web Worker

I am having the same issue. Did you ever figure out a solution @ptarjan?

It turns out the pictures were the really expensive part. So I did those in a separate request.

Gotcha… Doing a separate request prevents the ui blocking for you? Or are you just timing it where it’s not noticeable?

I’m timing it for later