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.0.4 to 5.0.5

5

example/App.js

@@ -68,2 +68,3 @@ /**

const phoneNumberRegex = /\b[\+]?[(]?[0-9]{2,6}[)]?[-\s\.]?[-\s\/\.0-9]{3,15}\b/m;
const emailAddressRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/i;
if (text === "" || text === null) {

@@ -75,2 +76,6 @@ this.loadContacts();

});
} else if (emailAddressRegex.test(text)) {
Contacts.getContactsByEmailAddress(text, (err, contacts) => {
this.setState({ contacts });
});
} else {

@@ -77,0 +82,0 @@ Contacts.getContactsMatchingString(text, (err, contacts) => {

1

index.d.ts

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

recordID: string;
backTitle: string;
company: string;

@@ -49,0 +50,0 @@ emailAddresses: EmailAddress[];

2

package.json

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

},
"version": "5.0.4",
"version": "5.0.5",
"description": "React Native Contacts (android & ios)",

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

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

## Installation
To use this module you have to install it and configure the permissions. Please read this entire section.
_Please read this entire section._
Install with npm or yarn.
### npm
With npm
```

@@ -55,25 +54,15 @@ npm install react-native-contacts --save

With yarn
### yarn
```
yarn add react-native-contacts
```
and then configure your project.
### iOS
### react native version 60 and above
Using the same instructions as https://facebook.github.io/react-native/docs/linking-libraries-ios.html
1. open in xcode `open ios/yourProject.xcodeproj/`
1. drag `./node_modules/react-native-contacts/ios/RCTContacts.xcodeproj` to `Libraries` in you project view.
1. In the XCode project navigator, select your project,
select the `Build Phases` tab drag `Libraries > RCTContacts.xcodeproj > Products > libRCTContacts.a` into the `Link Binary With Libraries` section. Video to clarify
[Adding Camera Roll to an ios project in React Native](https://www.youtube.com/watch?v=e3ReNbQu79c).
1. Add kit specific "permission" keys to your Xcode `Info.plist` file, in order to make `requestPermission` work. Otherwise your app crashes when requesting the specific permission. Open `Info.plist`. Add key `Privacy - Contacts Usage Description` with your kit specific permission. The value for the key is optional in development. If you submit to the App Store the value must explain why you need this permission.
If you are using react native version 0.60 or above you do not have to link this library.
<img width="338" alt="screen shot 2016-09-21 at 13 13 21" src="https://cloud.githubusercontent.com/assets/5707542/18704973/3cde3b44-7ffd-11e6-918b-63888e33f983.png">
#### ios
Starting with 0.60 on iOS you have to do the following:
You should be able to run the app via the Run button in xcode or `react-native run-ios` in the terminal.
#### Using CocoaPods (react-native 0.60 and above)
Starting with 0.60, the above instructions stop working on iOS. Instead, you have to do the following:
- Add the following line inside `ios/Podfile`

@@ -91,2 +80,16 @@

### react native below 60
#### iOS
Using the same instructions as https://facebook.github.io/react-native/docs/linking-libraries-ios.html
1. open in xcode `open ios/yourProject.xcodeproj/`
1. drag `./node_modules/react-native-contacts/ios/RCTContacts.xcodeproj` to `Libraries` in your project view.
1. In the XCode project navigator, select your project,
select the `Build Phases` tab drag `Libraries > RCTContacts.xcodeproj > Products > libRCTContacts.a` into the `Link Binary With Libraries` section. Video to clarify
[Adding Camera Roll to an ios project in React Native](https://www.youtube.com/watch?v=e3ReNbQu79c).
Run the app via the Run button in xcode or `react-native run-ios` in the terminal.
### Android

@@ -160,2 +163,9 @@ For react native versions 0.60 and above you have to use Android X. Android X support was added to react-native-contacts in version 5.x+. If you are using rn 0.59 and below install rnc versions 4.x instead.

### All RN versions
#### ios
Add kit specific "permission" keys to your Xcode `Info.plist` file, in order to make `requestPermission` work. Otherwise your app crashes when requesting the specific permission. Open `Info.plist`. Add key `Privacy - Contacts Usage Description` with your kit specific permission. The value for the key is optional in development. If you submit to the App Store the value must explain why you need this permission.
<img width="338" alt="screen shot 2016-09-21 at 13 13 21" src="https://cloud.githubusercontent.com/assets/5707542/18704973/3cde3b44-7ffd-11e6-918b-63888e33f983.png">
## API

@@ -173,2 +183,3 @@ * `getAll` (callback) - returns *all* contacts as an array of objects

* `getContactsByPhoneNumber` (string, callback) - where string is a phone number to match to.
* `getContactsByEmailAddress` (string, callback) - where string is an email address to match to.
* `checkPermission` (callback) - checks permission to access Contacts _ios only_

@@ -175,0 +186,0 @@ * `requestPermission` (callback) - request permission to access Contacts _ios only_

Sorry, the diff of this file is not supported yet

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