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

Commit 20cfb9a

Browse files
committed
Merge pull request #223 from Microsoft/doc_updates
Adding iOS docs for RNPM/CocoaPods installation
2 parents f9558e9 + 1e60aea commit 20cfb9a

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

README.md

Lines changed: 44 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,56 @@ 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+
*Note: If you don't already have RNPM installed, you can do so by simply running `npm i -g rnpm` and then executing the above command.*
103+
104+
2. Open your app's Xcode project
105+
106+
3. Select the project node in Xcode and select the "Build Phases" tab of your project configuration.
107+
108+
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.
109+
110+
![Libz reference](https://cloud.githubusercontent.com/assets/116461/11605042/6f786e64-9aaa-11e5-8ca7-14b852f808b1.png)
111+
112+
*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`.*
113+
114+
We hope to eventually remove the need for steps #2-4, but in the meantime, RNPM doesn't support automating them.
115+
116+
#### Plugin Installation (iOS - CocoaPods)
117+
118+
1. Add the CodePush plugin dependency to your `Podfile`, pointing at the path where NPM installed it
119+
120+
```ruby
121+
pod 'CodePush', :path => './node_modules/react-native-code-push`
122+
```
123+
124+
2. Run `pod install`
125+
126+
#### Plugin Installation (iOS - Manual)
127+
87128
1. Open your app's Xcode project
129+
88130
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
89131

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

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

0 commit comments

Comments
 (0)