v29 Contacts API problem

#1

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:
image

log:
image

the contact Sam should have phone number and email

1 Like
expo 29.0.0 android contacts
#2

I am getting the exact same error with sdk 29.
Everything works fine on ios. Android contacts are missing phone, email, etc.

#3

Hi all!

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. :slight_smile:

#4

Yesss, I have the same problem here. Getting all contacts without phoneNumbers and emails, but just on Android. iOS is fine here, too.

#6

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.

To use the react-native-contacts API it looks like I would have to ‘eject’ from Expo, which I don’t think is an option for my project.https://www.minimilitia.mobi/ https://www.applock.ooo/ https://www.7zip.vip/

#7

EDIT:
This is fixed in v30. expo-contacts


@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.

#8

but in Android is missing the PHONE NUMBER…
there is all information in getContactsAsync but not the numbers… is a bug?
EXPo 29.0.0
thanks

#9

This is definitely a defect

  1. the ‘summary’ list of contacts on android previously contained additional detail including phone/email in SDK 28
  2. It works in ios but not android

Is this bug on the expo team’s radar?

#10

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.

#11

Bumping to keep this alive. Having the same problem with respect to my Android Device. Pixel 2XL. Contacts functions fine for my iPhone 6s.

1 Like
#12

Hi all, I’ve opened up an issue about this behavior so we can track it on Github. https://github.com/expo/expo/issues/2113

1 Like
closed #13

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.