From 0119e7ddc8522e7f8059814b4cd6b7106baebf18 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Fri, 4 Dec 2015 17:38:21 -0800 Subject: [PATCH 1/3] Adding asset docs and bumping the version --- README.md | 32 +++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b8ba6a5..bcf3e3a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The CodePush plugin helps get product improvements in front of your end-users in - iOS - Android -*Note: CodePush now requires v0.14.0+ of React Native.* +*Note: CodePush 1.3.0 requires v0.14.0+ of React Native, and CodePush 1.4.0 requires v0.15.0+ of React Native, so much sure you are using the right version of the CodePush plugin.* ## Getting Started @@ -41,7 +41,13 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod ![Link CodePush during build](https://cloud.githubusercontent.com/assets/516559/10322221/a75ea066-6c31-11e5-9d88-ff6f6a4d6968.png) -5. Under the "Build Settings" tab of your project configuration, find the "Header Search Paths" section and edit the value. +5. Click the plus sign underneath the "Link Binary With Libraries" list and select the `libz.tbd` library underneath the `iOS 9.1` node. + + ![Libz reference](https://cloud.githubusercontent.com/assets/116461/11605042/6f786e64-9aaa-11e5-8ca7-14b852f808b1.png) + + *Note: Alternatively, you could add the `-lz` flag to the `Other Linker Flags` field in the `Linking` section of the `Build Settings` if you would prefer.* + +6. Under the "Build Settings" tab of your project configuration, find the "Header Search Paths" section and edit the value. Add a new value, `$(SRCROOT)/../node_modules/react-native-code-push` and select "recursive" in the dropdown. ![Add CodePush library reference](https://cloud.githubusercontent.com/assets/516559/10322038/b8157962-6c30-11e5-9264-494d65fd2626.png) @@ -182,7 +188,27 @@ Once your app has been configured and distributed to your users, and you've made 1. Execute `react-native bundle` in order to generate the updated JS bundle for your app. 2. Execute `code-push release --deploymentName ` in order to publish the generated JS bundle to the server. Assuming your CWD is the root directory of your React Native app, `` could be `iOS/main.jsbundle` for iOS, or `android/app/src/main/assets/index.android.jsbundle` for Android. -And that's it! For more information regarding the CodePush API, including the various options you can pass to the `sync` method, refer to the reference section below. Additionally, for more information regarding the CLI and how the release (or promote) commands work, refer to it's [documentation](http://microsoft.github.io/code-push/docs/cli.html). +And that's it! For more information regarding the CodePush API, including the various options you can pass to the `sync` method, refer to the reference section below. Additionally, for more information regarding the CLI and how the release (or promote and rollback) commands work, refer to it's [documentation](http://microsoft.github.io/code-push/docs/cli.html). + +## Releasing asset updates - iOS + +If you are using the new React Native [assets system](https://facebook.github.io/react-native/docs/images.html#content), as opposed to loading your images from the network and/or platform-specific mechanisms (e.g. iOS asset catalogs), then you can't simply pass your jsbundle to CodePush as demonstrated above, you need to send your images as well. To do this, simply use the following workflow: + +1. When calling `react-native bundle`, specify that your assets and JS bundle go into a new "release" folder (you can call this anything, but it shouldn't contain any other files). For example: + + ``` + react-native bundle \ + --platform ios \ + --entry-file index.ios.js \ + --bundle-output ./release/main.jsbundle \ + --assets-dest ./release + ``` + +2. Execute `code-push release`, passing the path to the directory you used in #1 as the "package" parameter (e.g. `code-push release Foo ./release 1.0.0`). The code-push CLI will automatically handle zipping up the contents for you, so don't worry about handling that yourself. + +Additionally, the CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end-users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end-user downloads. + +*Note: Releasing assets via CodePush is currently only supported on iOS, and requires that you're using React Native v0.15.0* --- diff --git a/package.json b/package.json index 3820303..51d48dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-code-push", - "version": "1.3.1-beta", + "version": "1.4.0-beta", "description": "React Native plugin for the CodePush service", "main": "CodePush.js", "homepage": "https://microsoft.github.io/code-push", From 2865f7b1028a438e75453674f82aa59309d0db56 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Fri, 4 Dec 2015 17:42:18 -0800 Subject: [PATCH 2/3] Minor fixes --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bcf3e3a..64b28a8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The CodePush plugin helps get product improvements in front of your end-users in - iOS - Android -*Note: CodePush 1.3.0 requires v0.14.0+ of React Native, and CodePush 1.4.0 requires v0.15.0+ of React Native, so much sure you are using the right version of the CodePush plugin.* +*Note: CodePush 1.3.0 requires v0.14.0+ of React Native, and CodePush 1.4.0 requires v0.15.0+ of React Native, so make sure you are using the right version of the CodePush plugin.* ## Getting Started @@ -45,7 +45,7 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod ![Libz reference](https://cloud.githubusercontent.com/assets/116461/11605042/6f786e64-9aaa-11e5-8ca7-14b852f808b1.png) - *Note: Alternatively, you could add the `-lz` flag to the `Other Linker Flags` field in the `Linking` section of the `Build Settings` if you would prefer.* + *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`.* 6. Under the "Build Settings" tab of your project configuration, find the "Header Search Paths" section and edit the value. Add a new value, `$(SRCROOT)/../node_modules/react-native-code-push` and select "recursive" in the dropdown. @@ -192,7 +192,7 @@ And that's it! For more information regarding the CodePush API, including the va ## Releasing asset updates - iOS -If you are using the new React Native [assets system](https://facebook.github.io/react-native/docs/images.html#content), as opposed to loading your images from the network and/or platform-specific mechanisms (e.g. iOS asset catalogs), then you can't simply pass your jsbundle to CodePush as demonstrated above, you need to send your images as well. To do this, simply use the following workflow: +If you are using the new React Native [assets system](https://facebook.github.io/react-native/docs/images.html#content), as opposed to loading your images from the network and/or platform-specific mechanisms (e.g. iOS asset catalogs), then you can't simply pass your jsbundle to CodePush as demonstrated above. You need to provide your images as well. To do this, simply use the following workflow: 1. When calling `react-native bundle`, specify that your assets and JS bundle go into a new "release" folder (you can call this anything, but it shouldn't contain any other files). For example: @@ -208,7 +208,7 @@ If you are using the new React Native [assets system](https://facebook.github.io Additionally, the CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end-users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end-user downloads. -*Note: Releasing assets via CodePush is currently only supported on iOS, and requires that you're using React Native v0.15.0* +*Note: Releasing assets via CodePush is currently only supported on iOS, and requires that you're using React Native v0.15.0+.* --- From 43bf51c6b4c606c8d18ad83a89b1cbe4d0725b5b Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Fri, 4 Dec 2015 18:07:17 -0800 Subject: [PATCH 3/3] Minor fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 64b28a8..5f18dbb 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The CodePush plugin helps get product improvements in front of your end-users in - iOS - Android -*Note: CodePush 1.3.0 requires v0.14.0+ of React Native, and CodePush 1.4.0 requires v0.15.0+ of React Native, so make sure you are using the right version of the CodePush plugin.* +*Note: CodePush v1.3.0 requires v0.14.0+ of React Native, and CodePush v1.4.0 requires v0.15.0+ of React Native, so make sure you are using the right version of the CodePush plugin.* ## Getting Started @@ -188,7 +188,7 @@ Once your app has been configured and distributed to your users, and you've made 1. Execute `react-native bundle` in order to generate the updated JS bundle for your app. 2. Execute `code-push release --deploymentName ` in order to publish the generated JS bundle to the server. Assuming your CWD is the root directory of your React Native app, `` could be `iOS/main.jsbundle` for iOS, or `android/app/src/main/assets/index.android.jsbundle` for Android. -And that's it! For more information regarding the CodePush API, including the various options you can pass to the `sync` method, refer to the reference section below. Additionally, for more information regarding the CLI and how the release (or promote and rollback) commands work, refer to it's [documentation](http://microsoft.github.io/code-push/docs/cli.html). +And that's it! For more information regarding the CodePush API, including the various options you can pass to the `sync` method, refer to the reference section below. Additionally, for more information regarding the CLI and how the release (or promote and rollback) commands work, refer to the [documentation](http://microsoft.github.io/code-push/docs/cli.html). ## Releasing asset updates - iOS