From c232b00e101d646091856e38ac7f12b862975241 Mon Sep 17 00:00:00 2001 From: Aleck Greenham Date: Tue, 9 Aug 2016 11:50:17 +0100 Subject: [PATCH 1/4] Add separate Android installation step for >= 0.29 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index e28ccdd..755c245 100644 --- a/README.md +++ b/README.md @@ -581,10 +581,19 @@ To set this up, perform the following steps: 4. Open up your `MainActivity.java` file and change the `CodePush` constructor to pass the deployment key in via the build config you just defined, as opposed to a string literal. +**For React Native >= v0.29** + + ```java + new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG); + ``` + +**For React Native v0.19 - v0.28** + ```java new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG); ``` + *Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.* And that's it! Now when you run or build your app, your debug builds will automatically be configured to sync with your `Staging` deployment, and your release builds will be configured to sync with your `Production` deployment. From fda51752149724562b4e490d69f216fb14771f30 Mon Sep 17 00:00:00 2001 From: Aleck Greenham Date: Tue, 9 Aug 2016 11:51:33 +0100 Subject: [PATCH 2/4] Fix formatting of previous amendment to Readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 755c245..77b7134 100644 --- a/README.md +++ b/README.md @@ -583,15 +583,15 @@ To set this up, perform the following steps: **For React Native >= v0.29** - ```java - new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG); - ``` - + ```java + new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG); + ``` + **For React Native v0.19 - v0.28** - ```java - new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG); - ``` + ```java + new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG); + ``` *Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.* From 4e2d78c7ebf804f1dcc1623129ca514141b039cf Mon Sep 17 00:00:00 2001 From: Aleck Greenham Date: Tue, 9 Aug 2016 11:54:51 +0100 Subject: [PATCH 3/4] Remove accidental placement of note in code block in Readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 77b7134..043d221 100644 --- a/README.md +++ b/README.md @@ -593,8 +593,7 @@ To set this up, perform the following steps: new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG); ``` - - *Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.* +*Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.* And that's it! Now when you run or build your app, your debug builds will automatically be configured to sync with your `Staging` deployment, and your release builds will be configured to sync with your `Production` deployment. From b354a0ec11d4a38333e45e03f69c89f8d798da6d Mon Sep 17 00:00:00 2001 From: Aleck Greenham Date: Tue, 9 Aug 2016 12:22:45 +0100 Subject: [PATCH 4/4] Update instructions to refer to correct files in Readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 043d221..e0b5469 100644 --- a/README.md +++ b/README.md @@ -579,16 +579,20 @@ To set this up, perform the following steps: *NOTE: As a reminder, you can retrieve these keys by running `code-push deployment ls -k` from your terminal.* -4. Open up your `MainActivity.java` file and change the `CodePush` constructor to pass the deployment key in via the build config you just defined, as opposed to a string literal. +4. Pass the deployment key to the `CodePush` constructor via the build config you just defined, as opposed to a string literal. **For React Native >= v0.29** +Open up your `MainApplication.java` file and make the following changes: + ```java new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG); ``` **For React Native v0.19 - v0.28** +Open up your `MainActivity.java` file and make the following changes: + ```java new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG); ```