I can’t retrieve phone number on Android after upgraded to new expo while IOS works fine. I noticed the contacts API changes mentioned in your blog but still can’t get it work, please help…
code:
log:
the contact Sam should have phone number and email
Turns out at least phone numbers and e-mail addresses are accessible only with getContactByIdAsync() method. Whether it is by design or by accident, @bacon will know.
I have the same use case - and have also written JS code for filtering the full list. I need all the contacts in a pick list so that I can select one of them - but it takes more than 60 seconds to bring them in (with extra overhead for sorting and removing the duplicates).
BTW, since it takes so long, I get a message on my phone saying "Debugger and device times have drifted by more than 60s " - and then it all reloads, so I can’t actually see them on my phone. Perhaps this will work a lot faster when not in development mode but ideally, I’d expect all contacts (sorted and ready to do) to load in a second or two - just like in other apps on my Android phone. I am running Android 7, Expo 18. A contacts querying API might help - assuming it also offered a near instantaneous response.
@jeniferpandey the Expo 18 API is no longer supported. On top of that, the contacts API hadn’t been updated for a while.
I just recently released a new contacts API in v29 (which appears to be buggy on Android?).
The speed issue you are facing may have to do with the way images are cached. (iOS)
AFAIK on Android there is no way to page your contacts. This means that paging on Android is really only serializing and returning a certain amount of contacts.
I would recommend taking a look at the new Contacts demo https://github.com/expo/native-component-list/tree/master/screens/Contacts
notice how only basic information is queried, then more detailed info is retrieved later.
This is a critical issue that must be fixed, there must be at least name, phone, email, picture available on the fetch async, please expo team’s, do something about this weird behavior.