Skip to content

Feature Request: Real time contacts #809

@morenoh149

Description

@morenoh149

How can I get or fetch real time contacts in React Native?
Asked 2 years, 9 months ago
Modified 2 years, 3 months ago
Viewed 474 times
Vote

How to get or fetch real time contacts in React Native. I used react-native-contacts library. first of all I'm getting my all contacts in app. but suppose if I change any contacts name in my phone then it should be updated in my app as well. right now it is not update the name.

I already tried the permissions of read and write contacts and profile permission as well. The good thing is it is working well in iOS and Android older versions. Issue came in new Android versions like Android version 10, 11,12 and 13.

javascriptreactjsreact-nativecontactsreact-native-contacts
Share
Edit
Follow
Close
Flag
edited Oct 25, 2023 at 17:23
Nimantha's user avatar
Nimantha
6,51366 gold badges3232 silver badges7878 bronze badges
asked Apr 18, 2023 at 13:33
vrinsoft's user avatar
vrinsoft
111 bronze badge
Add a comment
Start a bounty
1 Answer
Sorted by:
Reset to default

Date modified (newest first)
Vote

As far as I know, there is no built-in method at present in React Native that can detect when a new contact is added in phone. Hence you will need to implement a custom native plugin of your own.

For Android, starting with API level 18, you can use Contacts.CONTACT_LAST_UPDATED_TIMESTAMP, so I guess it may be possible to query for all contacts that had been modified (or created) recently, and compare only those to your last cache of contact ids, and the delta would be the contacts created since the last time your application code ran.

https://stackoverflow.com/questions/76045251/how-can-i-get-or-fetch-real-time-contacts-in-react-native

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions