Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 5bcee49

Browse files
committed
Adding docs for RNPM/CocoaPods installation
1 parent f9558e9 commit 5bcee49

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ This plugin provides client-side integration for the [CodePush service](http://c
88
* [Getting Started](#getting-started)
99
* [iOS Setup](#ios-setup)
1010
* [Plugin Installation](#plugin-installation-ios)
11+
* [RNPM](#plugin-installation-ios---rnpm)
12+
* [CocoaPods](#plugin-installation-ios---cocoapods)
13+
* ["Manual"](#plugin-installation-ios---manual)
1114
* [Plugin Configuration](#plugin-configuration-ios)
1215
* [Android Setup](#android-setup)
1316
* [Plugin Installation](#plugin-installation-android)
@@ -80,16 +83,54 @@ If you want to see how other projects have integrated with CodePush, you can che
8083

8184
## iOS Setup
8285

83-
Once you've acquired the CodePush plugin, you need to integrate it into the Xcode project of your React Native app. To do this, take the following steps:
86+
Once you've acquired the CodePush plugin, you need to integrate it into the Xcode project of your React Native app and configure it correctly. To do this, take the following steps:
8487

8588
### Plugin Installation (iOS)
8689

90+
In order to accomodate as many developer preferences as possible, the CodePush plugin supports iOS installation via three mechanisms:
91+
92+
1. [**RNPM**](#plugin-installation-ios---rnpm) - [React Native Package Manager (RNPM)](https://github.com/rnpm/rnpm) is an awesome tool that provides the simplest installation experience possible for React Native plugins. If you're already using it, or you want to use it, then we recommend this approach.
93+
94+
2. [**CocoaPods**](#plugin-installation-ios---cocoapods) - If you're building a native iOS app that is embedding React Native into it, or you simply prefer using [CocoaPods](https://cocoapods.org), then we recommend using the Podspec file that we ship as part of our plugin.
95+
96+
3. [**"Manual"**](#plugin-installation-ios---manual) - If you don't want to depend on any additional tools or are fine with a few extra installation steps (it's a one-time thing), then go with this approach.
97+
98+
#### Plugin Installation (iOS - RNPM)
99+
100+
1. Run `rnpm link react-native-code-push`
101+
102+
2. Open your app's Xcode project
103+
104+
3. Select the project node in Xcode and select the "Build Phases" tab of your project configuration.
105+
106+
4. Click the plus sign underneath the "Link Binary With Libraries" list and select the `libz.tbd` library underneath the `iOS` node that matches your target version.
107+
108+
![Libz reference](https://cloud.githubusercontent.com/assets/116461/11605042/6f786e64-9aaa-11e5-8ca7-14b852f808b1.png)
109+
110+
*Note: Alternatively, if you prefer, you can add the `-lz` flag to the `Other Linker Flags` field in the `Linking` section of the `Build Settings`.*
111+
112+
We hope to eventually remove the need for steps #2-4, but in the meantime, RNPM doesn't support automating them.
113+
114+
#### Plugin Installation (iOS - CocoaPods)
115+
116+
1. Add the CodePush plugin dependency to your `Podfile`, pointing at the path where NPM installed it
117+
118+
```ruby
119+
pod 'CodePush', :path => './node_modules/react-native-code-push`
120+
```
121+
122+
2. Run `pod install`
123+
124+
#### Plugin Installation (iOS - Manual)
125+
87126
1. Open your app's Xcode project
127+
88128
2. Find the `CodePush.xcodeproj` file within the `node_modules/react-native-code-push/ios` directory (or `node_modules/react-native-code-push` for <=`1.7.3-beta` installations) and drag it into the `Libraries` node in Xcode
89129

90130
![Add CodePush to project](https://cloud.githubusercontent.com/assets/8598682/13368613/c5c21422-dca0-11e5-8594-c0ec5bde9d81.png)
91131

92132
3. Select the project node in Xcode and select the "Build Phases" tab of your project configuration.
133+
93134
4. Drag `libCodePush.a` from `Libraries/CodePush.xcodeproj/Products` into the "Link Binary With Libraries" section of your project's "Build Phases" configuration.
94135
95136
![Link CodePush during build](https://cloud.githubusercontent.com/assets/516559/10322221/a75ea066-6c31-11e5-9d88-ff6f6a4d6968.png)

0 commit comments

Comments
 (0)