Socket
Socket
Sign inDemoInstall

react-native-contacts

Package Overview
Dependencies
Maintainers
3
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-contacts - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

.github/workflows/npm-publish.yml

6

index.d.ts

@@ -41,2 +41,7 @@ export function getAll(callback: (error: any, contacts: Contact[]) => void): void;

export interface InstantMessageAddress {
username: string;
service: string;
}
export interface Birthday {

@@ -65,3 +70,4 @@ day: number;

birthday: Birthday;
imAddresses: InstantMessageAddress[]
note: string;
}

2

package.json

@@ -7,3 +7,3 @@ {

},
"version": "5.1.0",
"version": "5.2.0",
"description": "React Native Contacts (android & ios)",

@@ -10,0 +10,0 @@ "nativePackage": true,

@@ -9,3 +9,3 @@ ![react-native-contacts](https://github.com/rt2zz/react-native-contacts/raw/master/example/logo.png)

`getAll` is a database intensive process, and can take a long time to complete depending on the size of the contacts list. Because of this, it is recommended you access the `getAll` method before it is needed, and cache the results for future use.
```es
```js
import Contacts from 'react-native-contacts';

@@ -24,3 +24,3 @@

On android you must request permissions beforehand
```es
```js
import { PermissionsAndroid } from 'react-native';

@@ -199,3 +199,3 @@ import Contacts from 'react-native-contacts';

## Example Contact Record
```es
```js
{

@@ -234,3 +234,7 @@ recordID: '6b2237ee0df85980',

department: '',
birthday: {'year': 1988, 'month': 0, 'day': 1 }
birthday: {'year': 1988, 'month': 0, 'day': 1 },
imAddresses: [
{ username: '0123456789', service: 'ICQ'},
{ username: 'johndoe123', service: 'Facebook'}
]
}

@@ -240,7 +244,6 @@ ```

* on Android versions below 8 the entire display name is passed in the `givenName` field. `middleName` and `familyName` will be `""`.
* on iOS the note field is not available.
## Adding Contacts
Currently all fields from the contact record except for thumbnailPath are supported for writing
```es
```js
var newPerson = {

@@ -263,3 +266,3 @@ emailAddresses: [{

Currently all fields from the contact record except for thumbnailPath are supported for writing
```es
```js
var newPerson = {

@@ -282,3 +285,3 @@ emailAddresses: [{

Example
```es
```js
Contacts.getAll((err, contacts) => {

@@ -311,3 +314,3 @@ if (err) {

You can delete a record using only it's recordID
```es
```js
Contacts.deleteContact({recordID: 1}, (err, recordId) => {

@@ -321,3 +324,3 @@ if (err) {

Or by passing the full contact object with a `recordID` field.
```es
```js
Contacts.deleteContact(contact, (err, recordId) => {

@@ -335,3 +338,3 @@ if (err) {

```es
```js
<Image source={{uri: contact.thumbnailPath}} />

@@ -345,3 +348,3 @@ ```

Usage as follows:
```es
```js
Contacts.checkPermission((err, permission) => {

@@ -348,0 +351,0 @@ if (err) throw err;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc