Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .podspec file and update installation instructions. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
# React-Native-LocalSearch
React Native Module for IOS MapKit Local Search

## Install
## Prerequisites
This module requires `react-native-maps` as a peer dependency. Run the following first if it is not an existing dependency.

```bash
npm install --save react-native-maps
```

## Install

```bash
npm install --save react-native-localsearch
```
Then add RNLocalSearch to project libraries.

After install, also run `pod install` for auto linking.

```bash
cd ios/ && pod install
```


## Usage

```javascript
var RNLocalSearch = require('react-native-localsearch');
import { RNLocalSearch } from 'react-native-localsearch';

RNLocalSearch.searchForLocations(searchString, region, callback(err, resp) => {});
```

## Example

```javascript
var RNLocalSearch = require('react-native-localsearch');
import { RNLocalSearch } from 'react-native-localsearch';

const region = {
latitude: 30.2669444,
Expand All @@ -27,5 +41,5 @@ const region = {
longitudeDelta: 0.1
};

RNLocalSearch.searchForLocations('Lalas', region, callback(err, resp) => {});
RNLocalSearch.searchForLocations('restaurants', region, callback(err, resp) => {});
```
5 changes: 2 additions & 3 deletions RNLocalSearch.ios.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var { NativeModules } = require('react-native');
var RNLocalSearch = NativeModules.RNLocalSearch;
import { NativeModules} from 'react-native'

module.exports = RNLocalSearch;
exports.RNLocalSearch = NativeModules.RNLocalSearch;
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-localsearch",
"version": "0.0.2",
"version": "0.0.4",
"description": "React Native Module for MapKit Local Search",
"main": "RNLocalSearch.ios.js",
"scripts": {
Expand All @@ -14,7 +14,8 @@
"author": "Will McMahan",
"license": "MIT",
"peerDependencies": {
"react-native": ">=0.10.0"
"react-native": ">=0.10.0",
"react-native-maps": ">=1.4.0"
},
"repository": {
"type": "git",
Expand Down
29 changes: 29 additions & 0 deletions react-native-localsearch.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "react-native-localsearch",
"version": "0.0.4",
"description": "React Native Module for MapKit Local Search",
"main": "RNLocalSearch.ios.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"react-component",
"react-native",
"ios"
],
"author": "Will McMahan",
"license": "MIT",
"peerDependencies": {
"react-native": ">=0.10.0",
"react-native-maps": ">=1.4.0"
},
"repository": {
"type": "git",
"url": "https://github.com/wmcmahan/React-Native-LocalSearch.git"
},
"bugs": {
"url": "https://github.com/wmcmahan/React-Native-LocalSearch/issues"
},
"homepage": "https://github.com/wmcmahan/React-Native-LocalSearch"
}