
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
react-native-paged-contacts
Advanced tools
Paged contacts manager for React Native.
Currently, only fetching contacts is supported.
RCTPagedContacts.xcodeproj to your project.Build Phases β Target Dependencies, add RCTPagedContacts.Build Phases β Link Libraries With Libraries, add RCTPagedContacts.NSContactsUsageDescription privacy key description to Info.plistAdd the following to settings.gradle:
include ':pagedcontacts'
project(':pagedcontacts').projectDir = new File(
rootProject.projectDir, '../node_modules/react-native-paged-contacts/android/')
Update dependencies in build.gradle.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':pagedcontacts') // <β Add this
...
}
(The dependency will be satisfied after npm install on the Example project)
Add the package PagedContactsPackage, to MainApplication.java
import com.wix.pagedcontacts.PagedContactsPackage; // <- Add this
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new PagedContactsPackage() // <- Add this
);
}
FYI: The READ_CONTACTS permission will automatically be merged into your build's AndroidManifest.xml
<uses-permission android:name="android.permission.READ_CONTACTS" />
The WRITE_CONTACTS permission is needed to use addContact method. and should be added to your build's AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
new PagedContacts() β Create a paged contacts manager for all device contacts.new PagedContacts(nameMatch) β Create a paged contacts manager for contacts matching the provided name.getAuthorizationStatus() β Returns the current authorization status to access the contact data.requestAccess() β Request contacts access from the operating system. This must be called before calling other APIs.setNameMatch(matchName) β Change the result set to filter contacts by matching name. Set to null to receive all contacts.getContactsCount() β Get the count of the current contacts set.getContactsWithRange(offset, batchSize, keysToFetch) β Get contacts within the requested batchSize, starting from offset. Only the keys requested in keysToFetch will be provided (contact identifiers are always provided).getContactsWithIdentifiers(identifiers, keysToFetch) β Get contacts with the provided identifiers. Only the keys requested in keysToFetch will be provided (contact identifiers are always provided).addContact(contact) - Add a contact to the device. Fields that can be set are the same as the keys described below. [1]dispose() β Disposes the native components. Call this method when the manager object is no longer required. Must not call any other methods of the contacts manager after calling dispose.PagedContacts.notDetermined β The user has not yet made a choice regarding whether the application may access contact data.PagedContacts.authorized β The application is authorized to access contact data.PagedContacts.denied β The user explicitly denied access to contact data for the application.PagedContacts.restricted β The application is not authorized to access contact data. The user cannot change this applicationβs status, possibly due to active restrictions such as parental controls being in place.PagedContacts.identifier β The contactβs unique identifier.PagedContacts.displayNamePagedContacts.namePrefix β Name prefix.PagedContacts.givenName β Given name.PagedContacts.middleName β Middle name.PagedContacts.familyName β Family prefix.PagedContacts.previousFamilyName β Previous family name. (iOS only)PagedContacts.nameSuffix β Name suffix.PagedContacts.nickname β Nickname.PagedContacts.organizationName β Organization name.PagedContacts.departmentName β Department name.PagedContacts.jobTitle β Job title.PagedContacts.phoneticGivenName β Phonetic given name.PagedContacts.phoneticMiddleName β Phonetic middle name.PagedContacts.phoneticFamilyName β Phonetic family name.PagedContacts.phoneticOrganizationName β Phonetic organization name.PagedContacts.birthday β Birthday.PagedContacts.nonGregorianBirthday β Non-Gregorian birthday. (iOS only)PagedContacts.note β Note.PagedContacts.imageData β Image data.PagedContacts.thumbnailImageData β Thumbnail data.PagedContacts.phoneNumbers β Phone numbers.PagedContacts.emailAddresses β Email addresses.PagedContacts.postalAddresses β Postal addresses.PagedContacts.dates β Contact dates.PagedContacts.urlAddresses β URL addresses.PagedContacts.relations β Contact relations.PagedContacts.socialProfiles β Social profiles. (iOS only)PagedContacts.instantMessageAddresses β Instant message addresses.Import the library and create a new PagedContacts instance.
import {PagedContacts} from 'react-native-paged-contacts';
let pg = new PagedContacts();
First request authorization, and, if granted, request the contacts. (iOS only)
pg.requestAccess().then((granted) => {
if(granted !== true)
{
return;
}
pg.getContactsCount().then( (count) => {
pg.getContactsWithRange(0, count, [PagedContacts.displayName, PagedContacts.thumbnailImageData, PagedContacts.phoneNumbers, PagedContacts.emailAddresses]).then((contacts) => {
//Use contacts here
});
});
});
This is a very intensive way of obtaining specific keys of all contacts. Instead, use the paging mechanism to obtain contacts within a range, and only request keys you need.
{
"familyName": "Zakroff",
"nonGregorianBirthday": "1961-12-25T22:00:00.000Z",
"birthday": "1961-12-26T00:00:00.000Z",
"contactRelations": [
{
"label": "sister",
"value": "Kate Bell"
}
],
"nickname": "Hanky Panky",
"displayName": "Prof. Hank M. Zakroff Esq.",
"organizationName": "Financial Services Inc.",
"departmentName": "Legal",
"namePrefix": "Prof.",
"nameSuffix": "Esq.",
"socialProfiles": [
{
"label": "twitter",
"value": {
"urlString": "http:\/\/twitter.com\/HankyPanky",
"username": "HankyPanky",
"service": "Twitter"
}
},
{
"label": "facebook",
"value": {
"urlString": "http:\/\/www.facebook.com\/HankZakoff",
"username": "HankZakoff",
"service": "Facebook"
}
}
],
"dates": [
{
"label": "anniversary",
"value": "0001-12-01T00:00:00.000Z"
},
{
"label": "other",
"value": "2014-09-25T00:00:00.000Z"
}
],
"phoneNumbers": [
{
"label": "work",
"value": "(555) 766-4823"
},
{
"label": "other",
"value": "(707) 555-1854"
}
],
"identifier": "60CB0169-0747-4494-9F10-22F387226676",
"urlAddresses": [
{
"label": "homepage",
"value": "https:\/\/google.com"
}
],
"postalAddresses": [
{
"label": "work",
"value": {
"ISOCountryCode": "us",
"state": "CA",
"street": "1741 Kearny Street",
"city": "San Rafael",
"country": "",
"postalCode": "94901"
}
},
{
"label": "home",
"value": {
"ISOCountryCode": "il",
"state": "",
"street": "151 Jerusalem Avenue",
"city": "Tel Aviv - Jaffa",
"country": "Israel",
"postalCode": "68152"
}
}
],
"middleName": "M.",
"jobTitle": "Partner",
"note": "Best lawyer ever!",
"emailAddresses": [
{
"label": "work",
"value": "hank-zakroff@mac.com"
}
],
"givenName": "Hank",
"instantMessageAddresses": [
{
"label": "Facebook",
"value": {
"service": "Facebook",
"username": "HankZakoff"
}
},
{
"label": "Skype",
"value": {
"service": "Skype",
"username": "HZakoff"
}
}
]
}
1 : Contact's image can be set using an extra imageUrl field (iOS only)
FAQs
React Native Paged Contacts
The npm package react-native-paged-contacts receives a total of 174 weekly downloads. As such, react-native-paged-contacts popularity was classified as not popular.
We found that react-native-paged-contacts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.