React-native-code-push: [docs] CodePush updates should be tested in modes other than debug

Created on 27 Jan 2017  路  4Comments  路  Source: microsoft/react-native-code-push

The fact, that JS bundle is still loaded via React Native packager (due to jsCodeLocation variable is configured to use React Native packager for each app restart in debug mode) after CodePush updates were installed, is confusing: there are two questions about testing CodePush updates in Debug mode: #672 and Microsoft/code-push#364.
I suppose documentation should be updated to specify that only release mode should be used to test CodePush updates.

enhancement

Most helpful comment

Hi! "Multi-Deployment Testing" section for Android has this line for MainApplication.java:
new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG). But if we not configure CodePush in debug mode this line causes error when react-native run-android: cannot find symbol ... variable CODEPUSH_KEY. So, how to prevent CodePush to run in debug mode?

All 4 comments

I suppose documentation should be updated to specify that only release mode should be used to test CodePush updates.

I would rather say that only modes other than debug should be used with code push.

This paragraph, more specifically

 debug {
            ...
            buildConfigField "String", "CODEPUSH_KEY", '"<INSERT_STAGING_KEY>"'
            ...
        }

should imo be updated, because it makes no sense to me to use code push in debug buildConfig. Rather I'd create a new buildConfig called staging and put this content into it. This is essentially what is discussed in #614

@vonovak, I've found another way we could add staging build variant - we have to use releaseStaging naming instead of staging as workaround due to this line.

Hi! "Multi-Deployment Testing" section for Android has this line for MainApplication.java:
new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG). But if we not configure CodePush in debug mode this line causes error when react-native run-android: cannot find symbol ... variable CODEPUSH_KEY. So, how to prevent CodePush to run in debug mode?

@kodemi, as workaround you could add

buildConfigField "String", "CODEPUSH_KEY", '""'

line here. It will prevent CodePush from installing updates due to empty deployment key.
Please let me know if you have any questions or see any issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanzhiri picture fanzhiri  路  3Comments

djw27 picture djw27  路  3Comments

Fuhrmann picture Fuhrmann  路  3Comments

EdmundMai picture EdmundMai  路  4Comments

jaysig picture jaysig  路  3Comments