Skip to content

Commit af26bde

Browse files
committed
Update README for new cocoapod description
1 parent af25ede commit af26bde

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,11 @@ npm install react-native-firestack --save
5454

5555
To use Firestack, we'll need to have a development environment that includes the same prerequisites of Firebase.
5656

57-
Regardless of which linking you choose to run with, it is _very_ important to "embed" the framework `libFirestack.a` in your application. Until we can find an automated way of handling this, *this needs to be done manually*.
57+
### iOS (with cocoapods)
5858

59-
#### iOS will _not_ be able to find `libFirestack.a` if you forget this step.
59+
Unfortunately, due to AppStore restrictions, we currently do _not_ package Firebase libraries in with Firestack. However, the good news is we've automated the process (with many thanks to the Auth0 team for inspiration) of setting up with cocoapods. This will happen automatically upon linking the package with `react-native-cli`.
6060

61-
Find your application tab in Xcode, click on `Build Phases`. In there, find the build phase of `Embed Frameworks` and click the `+` button and add `libFirestack.a` to the list. Make sure the `Code Sign on Copy` checkbox is ticked on and the destination is Frameworks with an empty subpath.
62-
63-
> If you do not see an `Embed Frameworks` build phase, do not fret! Click on the plus button on the build phases menu and select `New Copy Files Phase`. Make sure the destination is set to `Frameworks` and it'll be the same thing as the `Embed Frameworks` phase.
64-
65-
![Embed frameworks](http://d.pr/i/1aZq5.png)
66-
67-
### iOS
61+
**Remember to use the `ios/[YOUR APP NAME].xcworkspace` instead of the `ios/[YOUR APP NAME].xcproj` file from now on**.
6862

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

@@ -76,8 +70,6 @@ React native ships with a `link` command that can be used to link the projects t
7670
react-native link react-native-firestack
7771
```
7872

79-
Firestack will automatically pull in all of the Firebase requirements and link Firebase to our own project.
80-
8173
#### Manually
8274

8375
If you prefer not to use `rnpm`, we can manually link the package together with the following steps, after `npm install`:
@@ -98,9 +90,34 @@ If you prefer not to use `rnpm`, we can manually link the package together with
9890

9991
1. `$(SRCROOT)/../../react-native/React`
10092
2. `$(SRCROOT)/../node_modules/react-native/React`
93+
3. `${PROJECT_DIR}/../../../ios/Pods`
10194

10295
![Recursive paths](http://d.pr/i/1hAr1.png)
10396

97+
5. Setting up cocoapods
98+
99+
Since we're dependent upon cocoapods (or at least the Firebase libraries being available at the root project -- i.e. your application), we have to make them available for Firestack to find them.
100+
101+
Using cocoapods is the easiest way to get started with this linking. Add or update a `Podfile` at `ios/Podfile` in your app with the following:
102+
103+
```ruby
104+
source 'https://github.com/CocoaPods/Specs.git'
105+
[
106+
'Firebase/Core',
107+
'Firebase/Auth',
108+
'Firebase/Storage',
109+
'Firebase/Database',
110+
'Firebase/RemoteConfig',
111+
'Firebase/Messaging'
112+
].each do |lib|
113+
pod lib
114+
end
115+
```
116+
117+
Then you can run `(cd ios && pod install)` to get the pods opened. If you do use this route, remember to use the `.xcworkspace` file.
118+
119+
If you don't want to use cocoapods, you don't need to use it! Just make sure you link the Firebase libraries in your project manually. For more information, check out the relevant Firebase docs at [https://firebase.google.com/docs/ios/setup#frameworks](https://firebase.google.com/docs/ios/setup#frameworks).
120+
104121
### Android
105122

106123
Full Android support is coming soon, as it currently supports a smaller feature-set than the iOS version. Just as we do with iOS, we'll need to install the library using `npm` and call `link` on the library:

0 commit comments

Comments
 (0)