react-native-contacts: getPhotoForId crash on iOS

Hi

In the mean time we were trying to use the getPhotoForId function on iOS. We added the following code:

      Contacts.getPhotoForId(contactList[i].recordID, (err, result) => {
                   if (result != '') { console.log(' PATH RESULT : ',result); }     
     });

It does display path but on a real device with 3000 contacts, it often endup with a crash and the following error:

AB: Could not compile statement for query (ABCCopyArrayOfAllInstancesOfClassInSourceMatchingPredicates):
SELECT ROWID, Name, ExternalIdentifier, Type, ConstraintsPath, ExternalModificationTag, ExternalSyncTag, AccountID, Enabled, SyncData, MeIdentifier, Capabilities FROM ABStore WHERE Enabled = ?;

And sometime:

[error][tid:com.facebook.react.ContactsQueue][RCTConvert.m:59] JSON value '1' of type NSString cannot be converted to NSNumber

😦

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18

Most upvoted comments

ok, i’ve updated my fork so that all methods use the new iOS api. And there’s a test suite here that now has a load test. It’s quite slow, largely because adding contacts is slow, so be patient. And you need to point it at my fork…

I’ve tried to use it to reproduce the error you’re seeing but so far I’ve not managed to see the error.

Is it possible you’re making many calls to getPhotoForId in parallel and just overloading the phone?