Skip to content

Commit 7809f45

Browse files
committed
Add a Cocoapods podpsec
1 parent 37b2018 commit 7809f45

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ The easiest way to link the library is using the CLI tool by running this comman
3333
react-native link react-native-location
3434
```
3535

36-
### 1b. Or manually link the library
36+
### 1b. Install with Cocoapods
37+
You can also link the library using Cocoapods by adding this line to your `Podfile`:
38+
39+
```ruby
40+
pod 'react-native-location', :path => '../node_modules/react-native-location/react-native-location.podspec'
41+
```
42+
43+
### 1c. Or manually link the library
3744
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).
3845

3946
### 2. Ensure you have the CoreLocation library linked
47+
*This is not required if you have installed using Cocoapods.*
48+
4049
You then need to make sure you have the iOS CoreLocation library linked to your project.
4150

4251
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`.

react-native-location.podspec

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
5+
Pod::Spec.new do |s|
6+
s.name = 'react-native-location'
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.description = package['description']
10+
s.license = package['license']
11+
s.author = package['author']
12+
s.homepage = 'https://github.com/timfpark/react-native-location'
13+
s.source = { :git => "https://github.com/timfpark/react-native-location.git", :tag => "#{s.version}" }
14+
s.framework = 'CoreLocation'
15+
s.source_files = "ios/**/*.{h,m}"
16+
17+
s.ios.deployment_target = "8.0"
18+
19+
s.dependency "React"
20+
end

0 commit comments

Comments
 (0)