Skip to content

Commit

Permalink
Add a Cocoapods podpsec
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-oakes committed Jan 19, 2019
1 parent 37b2018 commit 7809f45
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -33,10 +33,19 @@ The easiest way to link the library is using the CLI tool by running this comman
react-native link react-native-location
```

### 1b. Or manually link the library
### 1b. Install with Cocoapods
You can also link the library using Cocoapods by adding this line to your `Podfile`:

```ruby
pod 'react-native-location', :path => '../node_modules/react-native-location/react-native-location.podspec'
```

### 1c. Or manually link the library
If you can't or don't want to use the CLI tool, you can also manually link the library using the [intructions in the React NAtive documentation](https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking).

### 2. Ensure you have the CoreLocation library linked
*This is not required if you have installed using Cocoapods.*

You then need to make sure you have the iOS CoreLocation library linked to your project.

To do this, click on the your project in XCode (the name of your project at the top of the left panel), select your apps build target, go to the `Build Phases` tab then in the `Link Binary With Libraries` section add `CoreLocation.framework`.
Expand Down
20 changes: 20 additions & 0 deletions react-native-location.podspec
@@ -0,0 +1,20 @@
require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.name = 'react-native-location'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.author = package['author']
s.homepage = 'https://github.com/timfpark/react-native-location'
s.source = { :git => "https://github.com/timfpark/react-native-location.git", :tag => "#{s.version}" }
s.framework = 'CoreLocation'
s.source_files = "ios/**/*.{h,m}"

s.ios.deployment_target = "8.0"

s.dependency "React"
end

0 comments on commit 7809f45

Please sign in to comment.