Skip to content

Commit 0a485c7

Browse files
committed
Fixed header search paths, organized for rn-link and updated readme installation instructions
1 parent b8cf94c commit 0a485c7

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,29 @@
33
Native GPS location support for React Native.
44

55
## Installation
6-
Install using npm with `npm install --save react-native-location`
6+
Three installation methods are provided here for compatibility and ease of use. All of them require installing the package using NPM. However, you can install the iOS specific bits using one of three methods: RNPM, React-Native Link (only v0.28), or manual linking in XCode.
77

8-
You then need to add the Objective C part to your XCode project. Drag `RNLocation.xcodeproj` from the `node_modules/react-native-location` folder into your XCode project. Click on the your project in XCode, goto Build Phases then Link Binary With Libraries and add `libRNLocation.a` and `CoreLocation.framework`.
8+
First step for all three is NPM Install to your project:
9+
10+
```
11+
npm install --save react-native-location
12+
```
13+
14+
### RNPM Installation
15+
For RNPM, first install RNPM globally and then simply run it with the 'link' command at the root of your project:
16+
```
17+
npm install rnpm -g
18+
rnpm Link
19+
```
20+
21+
### React-Native Link Installation
22+
Since version 0.28 of React Native, rnpm has been merged into the codebase. So, as long as you are using the latest version of the CLI, then you can simply run link:
23+
```
24+
react-native link
25+
```
26+
27+
### Manual Installation
28+
Finally, you can do a manual installation with XCode. Drag `ios/RNLocation.xcodeproj` from the `node_modules/react-native-location` folder into your XCode project. Click on the your project in XCode, goto Build Phases then Link Binary With Libraries and add `libRNLocation.a` and `CoreLocation.framework`.
929

1030
NOTE: Make sure you don't have the `RNLocation` project open separately in XCode otherwise it won't work.
1131

File renamed without changes.
File renamed without changes.

RNLocation.xcodeproj/project.pbxproj renamed to ios/RNLocation.xcodeproj/project.pbxproj

+14-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
58B511ED1A9E6C8500147676 /* Debug */ = {
123123
isa = XCBuildConfiguration;
124124
buildSettings = {
125-
ALWAYS_SEARCH_USER_PATHS = NO;
125+
ALWAYS_SEARCH_USER_PATHS = YES;
126126
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
127127
CLANG_CXX_LIBRARY = "libc++";
128128
CLANG_ENABLE_MODULES = YES;
@@ -152,6 +152,11 @@
152152
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
153153
GCC_WARN_UNUSED_FUNCTION = YES;
154154
GCC_WARN_UNUSED_VARIABLE = YES;
155+
"HEADER_SEARCH_PATHS[arch=*]" = (
156+
"$(SRCROOT)/../node_modules/react-native/React/**",
157+
"$(SRCROOT)/../../node_modules/react-native/React/**",
158+
"$(SRCROOT)/../../../node_modules/react-native/React/**",
159+
);
155160
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
156161
MTL_ENABLE_DEBUG_INFO = YES;
157162
ONLY_ACTIVE_ARCH = YES;
@@ -162,7 +167,7 @@
162167
58B511EE1A9E6C8500147676 /* Release */ = {
163168
isa = XCBuildConfiguration;
164169
buildSettings = {
165-
ALWAYS_SEARCH_USER_PATHS = NO;
170+
ALWAYS_SEARCH_USER_PATHS = YES;
166171
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
167172
CLANG_CXX_LIBRARY = "libc++";
168173
CLANG_ENABLE_MODULES = YES;
@@ -186,6 +191,11 @@
186191
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
187192
GCC_WARN_UNUSED_FUNCTION = YES;
188193
GCC_WARN_UNUSED_VARIABLE = YES;
194+
"HEADER_SEARCH_PATHS[arch=*]" = (
195+
"$(SRCROOT)/../node_modules/react-native/React/**",
196+
"$(SRCROOT)/../../node_modules/react-native/React/**",
197+
"$(SRCROOT)/../../../node_modules/react-native/React/**",
198+
);
189199
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
190200
MTL_ENABLE_DEBUG_INFO = NO;
191201
SDKROOT = iphoneos;
@@ -201,6 +211,7 @@
201211
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
202212
"$(SRCROOT)/../../React/**",
203213
"$(SRCROOT)/node_modules/react-native/React/**",
214+
"$(SRCROOT)/../../node_modules/react-native/React/**",
204215
"$(SRCROOT)/../react-native/React/**",
205216
);
206217
LIBRARY_SEARCH_PATHS = "$(inherited)";
@@ -219,6 +230,7 @@
219230
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
220231
"$(SRCROOT)/../../React/**",
221232
"$(SRCROOT)/node_modules/react-native/React/**",
233+
"$(SRCROOT)/../../node_modules/react-native/React/**",
222234
"$(SRCROOT)/../react-native/React/**",
223235
);
224236
LIBRARY_SEARCH_PATHS = "$(inherited)";

0 commit comments

Comments
 (0)