Update installation.ios.md

This commit is contained in:
Michael Diarmid 2017-04-06 13:11:43 +01:00 committed by GitHub
parent f33a486f40
commit c284f73c04
1 changed files with 12 additions and 14 deletions

View File

@ -1,12 +1,10 @@
# iOS Installation ## iOS Installation
## Firebase ### 1 - Setup google-services.plist and dependencies
Setup the `google-services.plist` file and Firebase ios frameworks first; check out the relevant Firebase docs [here](https://firebase.google.com/docs/ios/setup#frameworks).
### Setup #### 1.1 - Initialisation
Setup the Firebase ios frameworks first; check out the relevant Firebase docs [here](https://firebase.google.com/docs/ios/setup#frameworks). Make sure you've added the following to the top of your `ios/[YOUR APP NAME]]/AppDelegate.m` file:
### Initialisation
You need to add the following to the top of `ios/[YOUR APP NAME]]/AppDelegate.m`:
`#import <Firebase.h>` `#import <Firebase.h>`
@ -14,14 +12,14 @@ and this to the `didFinishLaunchingWithOptions:(NSDictionary *)launchOptions` me
`[FIRApp configure];` `[FIRApp configure];`
## RNFirebase ### 2 - Link RNFirebase
There are multiple ways to install RNFirebase dependent on how your project is currently setup: There are multiple ways to install RNFirebase depending on how your project is currently setup:
### 1) Existing Cocoapods setup, including React Native as a pod #### 2.1 - Existing Cocoapods setup, including React Native as a pod
Simply add the following to your `Podfile`: Simply add the following to your `Podfile`:
```ruby ```ruby
# Required by RNFirebase # Required by RNFirebase - you should already have some of these from step 1.
pod 'Firebase/Auth' pod 'Firebase/Auth'
pod 'Firebase/Analytics' pod 'Firebase/Analytics'
pod 'Firebase/AppIndexing' pod 'Firebase/AppIndexing'
@ -35,7 +33,7 @@ pod 'Firebase/Storage'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase' pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
``` ```
### 2) Automatically with react-native-cli #### 2.2 - Via react-native-cli link
React native ships with a `link` command that can be used to link the projects together, which can help automate the process of linking our package environments. React native ships with a `link` command that can be used to link the projects together, which can help automate the process of linking our package environments.
```bash ```bash
@ -48,12 +46,12 @@ Update the newly installed pods once the linking is done:
cd ios && pod update --verbose cd ios && pod update --verbose
``` ```
#### cocoapods ##### cocoapods
We've automated the process of setting up with cocoapods. This will happen automatically upon linking the package with `react-native-cli`. We've automated the process of setting up with cocoapods. This will happen automatically upon linking the package with `react-native-cli`.
**Remember to use the `ios/[YOUR APP NAME].xcworkspace` instead of the `ios/[YOUR APP NAME].xcproj` file from now on**. **Remember to use the `ios/[YOUR APP NAME].xcworkspace` instead of the `ios/[YOUR APP NAME].xcproj` file from now on**.
### 3) Manually #### 2.3 - Manually
If you prefer not to use `react-native link`, we can manually link the package together with the following steps, after `npm install`: If you prefer not to use `react-native link`, we can manually link the package together with the following steps, after `npm install`: