Skip to content

Commit 3e159ee

Browse files
committed
Updated README with linking instructions
1 parent 292b5a0 commit 3e159ee

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,38 @@ To use Firestack, we'll need to have a development environment that includes the
2424

2525
We need to link the package with our development packaging. We have two options to handle linking:
2626

27-
#### Through CocoaPods (iOS only)
27+
#### Automatically with [rnpm](https://github.com/rnpm/rnpm)
2828

29-
Unfortunately, until we can link cocoapods in a library dynamically, we must use CocoaPods to use Firestack. Although it's not terribly difficult to do, we're stuck with this requirement for the time being.
29+
[rnpm](https://github.com/rnpm/rnpm) is a React Native package manager which can help to automate the process of linking package environments.
3030

31-
In order to use cocoapods, we'll first need to install it. The [getting started](https://guides.cocoapods.org/using/getting-started.html) guide through CocoaPods offers a nice introduction on installing and using [Cocoapods](https://cocoapods.org/).
31+
```bash
32+
rnpm link
33+
```
3234

33-
Cocoapods is delivered as a ruby gem, so we'll need to make sure we have ruby installed. (We recommend using [rvm](https://rvm.io/)) to manage environments.
35+
Firestack will automatically pull in all of the Firebase requirements and link Firebase to our own project.
3436

35-
```shell
36-
gem install cocoapods
37-
```
37+
#### Manually
3838

39-
> If you run into issues installing cocoapods, please see their [getting started guide](https://guides.cocoapods.org/using/getting-started.html) for help.
39+
If you prefer not to use `rnpm`, we can manually link the package together with the following steps, after `npm install`:
4040

41+
1. In XCode, right click on `Libraries` and find the `Add Files to [project name]`.
4142

42-
With cocoapods installed, we'll need to create a `Podfile` to manage our dependencies and list our new `Firestack` library as a dependency of our project.
43+
![Add library to project](http://d.pr/i/2gEH.png)
4344

44-
```shell
45-
(cd ios && pod init)
46-
```
45+
2. Add the `node_modules/react-native-firestack/ios/Firestack.xcodeproj`
4746

48-
This command will create a `Podfile` in the `ios/` directory of our project. In this file, we'll need to list our dependencies. For now, we'll list one. The `Podfile` itself can be incredibly simple
47+
![Firebase.xcodeproj in Libraries listing](http://d.pr/i/19ktP.png)
4948

49+
3. In the project's "Build Settings" tab in your app's target, add `libFirestack.a` to the list of `Link Binary with Libraries`
5050

51-
```ruby
52-
platform :ios, '8.0'
53-
target 'RoundHere' do
54-
pod 'Firestack', :path => '../node_modules/react-native-firestack'
55-
end
56-
```
51+
![Linking binaries](http://d.pr/i/1cHgs.png)
52+
53+
4. Ensure that the `Build Settings` of the `Firestack.xcodeproj` project is ticked to _All_ and it's `Header Search Paths` include both of the following paths _and_ are set to _recursive_:
54+
55+
1. `$(SRCROOT)/../../react-native/React`
56+
2. `$(SRCROOT)/../node_modules/react-native/React`
57+
58+
![Recursive paths](http://d.pr/i/1hAr1.png)
5759

5860
### Android
5961

0 commit comments

Comments
 (0)