Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Spikef/react-native-phone-picker
React Native component for select phone number from address book.
https://github.com/Spikef/react-native-phone-picker
Last synced: about 1 month ago
JSON representation
React Native component for select phone number from address book.
- Host: GitHub
- URL: https://github.com/Spikef/react-native-phone-picker
- Owner: Spikef
- License: mit
- Created: 2015-08-29T07:25:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-05T09:28:24.000Z (over 6 years ago)
- Last Synced: 2024-11-22T22:14:14.895Z (about 2 months ago)
- Language: Objective-C
- Homepage:
- Size: 446 KB
- Stars: 68
- Watchers: 3
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-phone-picker ★58 - a quick phone picker control (Components / UI)
- awesome-react-native-native-modules - react-native-phone-picker ★52
- awesome-react-native - react-native-phone-picker ★58 - a quick phone picker control (Components / UI)
- awesome-reactnative-ui - react-native-phone-picker - native-phone-picker/raw/master/screenshots.gif)| (Others)
- awesome-react-native - react-native-phone-picker ★58 - a quick phone picker control (Components / UI)
- awesome-reactnative-ui - react-native-phone-picker - native-phone-picker/raw/master/screenshots.gif)| (Others)
- awesome-react-native - react-native-phone-picker ★58 - a quick phone picker control (Components / UI)
- awesome-react-native-ui - react-native-phone-picker ★31 - a quick phone picker control (Components / UI)
README
# react-native-phone-picker
React Native component for select phone number from address book
用于React Native的通讯录手机号选取模块
![image](https://github.com/Spikef/react-native-phone-picker/raw/master/screenshots.gif)
## Usage
```javascript
npm install react-native-phone-picker --save
```In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name], Go to node_modules ➜ react-native-phone-picker and add the `RNPhonePicker.xcodeproj` file
In XCode, in the project navigator, select your project. Add the lib*.a from the RNPhonePicker project to your project's Build Phases ➜ Link Binary With Libraries Click `RNPhonePicker.xcodeproj` file you added before in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for Header Search Paths and make sure it contains both $(SRCROOT)/../react-native/React and $(SRCROOT)/../../React - mark both as recursive.
Run your project (Cmd+R)
## Examples
```javascript
var PhonePicker = require('react-native-phone-picker');
PhonePicker.select(function(phone) {
if (phone) {
phone = phone.replace(/[^\d]/g, '');
if (/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(phone)) {
console.log(phone);
}
}
})
```