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

Commit fdb628a

Browse files
authored
Merge pull request #460 from greena13/master
Fix Android Multi-Deployment Testing Step 3 for RN >= 0.29
2 parents d3a5e84 + b354a0e commit fdb628a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,25 @@ To set this up, perform the following steps:
579579

580580
*NOTE: As a reminder, you can retrieve these keys by running `code-push deployment ls <APP_NAME> -k` from your terminal.*
581581

582-
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.
582+
4. Pass the deployment key to the `CodePush` constructor via the build config you just defined, as opposed to a string literal.
583583

584-
```java
585-
new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG);
586-
```
584+
**For React Native >= v0.29**
585+
586+
Open up your `MainApplication.java` file and make the following changes:
587+
588+
```java
589+
new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG);
590+
```
591+
592+
**For React Native v0.19 - v0.28**
593+
594+
Open up your `MainActivity.java` file and make the following changes:
595+
596+
```java
597+
new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG);
598+
```
587599

588-
*Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.*
600+
*Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.*
589601

590602
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.
591603

0 commit comments

Comments
 (0)