From 7809f456c79dc54fdebcbd1ac241abe7ffab1ab4 Mon Sep 17 00:00:00 2001 From: Matt Oakes Date: Sat, 19 Jan 2019 11:26:05 +0000 Subject: [PATCH] Add a Cocoapods podpsec --- README.md | 11 ++++++++++- react-native-location.podspec | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 react-native-location.podspec diff --git a/README.md b/README.md index 350f7ef..e196b4d 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/react-native-location.podspec b/react-native-location.podspec new file mode 100644 index 0000000..cd7e903 --- /dev/null +++ b/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 \ No newline at end of file