@algocare/react-native-code-push 9.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AlertAdapter.js +24 -0
- package/CONTRIBUTING.md +134 -0
- package/CodePush.js +778 -0
- package/CodePush.podspec +27 -0
- package/LICENSE.md +13 -0
- package/README.md +491 -0
- package/SECURITY.md +41 -0
- package/android/app/build.gradle +31 -0
- package/android/app/proguard-rules.pro +25 -0
- package/android/app/src/main/AndroidManifest.xml +6 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java +441 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushBuilder.java +37 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushConstants.java +35 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushDialog.java +102 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInstallMode.java +16 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidPublicKeyException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushInvalidUpdateException.java +7 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushMalformedDataException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java +714 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushNotInitializedException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushTelemetryManager.java +175 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUnknownException.java +12 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateManager.java +383 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateState.java +15 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUpdateUtils.java +268 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/CodePushUtils.java +238 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgress.java +30 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/DownloadProgressCallback.java +5 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/FileUtils.java +203 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/ReactInstanceHolder.java +17 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/SettingsManager.java +173 -0
- package/android/app/src/main/java/com/microsoft/codepush/react/TLSSocketFactory.java +72 -0
- package/android/build.gradle +21 -0
- package/android/codepush.gradle +162 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +20 -0
- package/android/gradlew +164 -0
- package/android/gradlew.bat +90 -0
- package/android/settings.gradle +1 -0
- package/babel.config.js +3 -0
- package/cli/commands/bundleCommand/bundleCodePush.js +57 -0
- package/cli/commands/bundleCommand/index.js +29 -0
- package/cli/commands/createHistoryCommand/createReleaseHistory.js +53 -0
- package/cli/commands/createHistoryCommand/index.js +29 -0
- package/cli/commands/releaseCommand/addToReleaseHistory.js +75 -0
- package/cli/commands/releaseCommand/index.js +66 -0
- package/cli/commands/releaseCommand/release.js +109 -0
- package/cli/commands/showHistoryCommand/index.js +29 -0
- package/cli/commands/updateHistoryCommand/index.js +50 -0
- package/cli/commands/updateHistoryCommand/updateReleaseHistory.js +62 -0
- package/cli/constant.js +6 -0
- package/cli/functions/getReactTempDir.js +16 -0
- package/cli/functions/makeCodePushBundle.js +28 -0
- package/cli/functions/prepareToBundleJS.js +12 -0
- package/cli/functions/runHermesEmitBinaryCommand.js +213 -0
- package/cli/functions/runReactNativeBundleCommand.js +59 -0
- package/cli/index.js +43 -0
- package/cli/utils/file-utils.js +42 -0
- package/cli/utils/fsUtils.js +49 -0
- package/cli/utils/hash-utils.js +227 -0
- package/cli/utils/promisfied-fs.js +29 -0
- package/cli/utils/showLogo.js +23 -0
- package/cli/utils/zip.js +89 -0
- package/code-push.config.example.supabase.ts +114 -0
- package/docs/api-android.md +83 -0
- package/docs/api-ios.md +31 -0
- package/docs/api-js.md +592 -0
- package/docs/multi-deployment-testing-android.md +148 -0
- package/docs/multi-deployment-testing-ios.md +59 -0
- package/docs/setup-android.md +482 -0
- package/docs/setup-ios.md +280 -0
- package/eslint.config.mjs +32 -0
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.h +34 -0
- package/ios/CodePush/Base64/Base64/MF_Base64Additions.m +252 -0
- package/ios/CodePush/Base64/README.md +47 -0
- package/ios/CodePush/CodePush.h +235 -0
- package/ios/CodePush/CodePush.m +1121 -0
- package/ios/CodePush/CodePushConfig.m +116 -0
- package/ios/CodePush/CodePushDownloadHandler.m +130 -0
- package/ios/CodePush/CodePushErrorUtils.m +20 -0
- package/ios/CodePush/CodePushPackage.m +602 -0
- package/ios/CodePush/CodePushTelemetryManager.m +175 -0
- package/ios/CodePush/CodePushUpdateUtils.m +376 -0
- package/ios/CodePush/CodePushUtils.m +9 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithm.h +69 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.h +16 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmFactory.m +51 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.h +15 -0
- package/ios/CodePush/JWT/Core/Algorithms/Base/JWTAlgorithmNone.m +55 -0
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.h +24 -0
- package/ios/CodePush/JWT/Core/Algorithms/ESFamily/JWTAlgorithmESBase.m +41 -0
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.h +28 -0
- package/ios/CodePush/JWT/Core/Algorithms/HSFamily/JWTAlgorithmHSBase.m +205 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.h +103 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolder.m +322 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.h +37 -0
- package/ios/CodePush/JWT/Core/Algorithms/Holders/JWTAlgorithmDataHolderChain.m +145 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.h +35 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTAlgorithmRSBase.m +551 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/JWTRSAlgorithm.h +23 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.h +43 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKey.m +230 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.h +31 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoKeyExtractor.m +113 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.h +38 -0
- package/ios/CodePush/JWT/Core/Algorithms/RSFamily/RSKeys/JWTCryptoSecurity.m +500 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.h +18 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaim.m +214 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.h +23 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSet.m +29 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.h +19 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetSerializer.m +68 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.h +18 -0
- package/ios/CodePush/JWT/Core/ClaimSet/JWTClaimsSetVerifier.m +72 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.h +67 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+ResultTypes.m +111 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.h +119 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionOne.m +307 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.h +94 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionThree.m +619 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.h +164 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding+VersionTwo.m +514 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.h +24 -0
- package/ios/CodePush/JWT/Core/Coding/JWTCoding.m +11 -0
- package/ios/CodePush/JWT/Core/FrameworkSupplement/JWT.h +52 -0
- package/ios/CodePush/JWT/Core/FrameworkSupplement/Map.modulemap +5 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.h +28 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTBase64Coder.m +70 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTDeprecations.h +22 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.h +34 -0
- package/ios/CodePush/JWT/Core/Supplement/JWTErrorDescription.m +73 -0
- package/ios/CodePush/JWT/LICENSE +19 -0
- package/ios/CodePush/JWT/README.md +489 -0
- package/ios/CodePush/RCTConvert+CodePushInstallMode.m +20 -0
- package/ios/CodePush/RCTConvert+CodePushUpdateState.m +20 -0
- package/ios/CodePush/SSZipArchive/Common.h +81 -0
- package/ios/CodePush/SSZipArchive/README.md +1 -0
- package/ios/CodePush/SSZipArchive/SSZipArchive.h +76 -0
- package/ios/CodePush/SSZipArchive/SSZipArchive.m +691 -0
- package/ios/CodePush/SSZipArchive/aes/aes.h +198 -0
- package/ios/CodePush/SSZipArchive/aes/aes_via_ace.h +541 -0
- package/ios/CodePush/SSZipArchive/aes/aescrypt.c +294 -0
- package/ios/CodePush/SSZipArchive/aes/aeskey.c +548 -0
- package/ios/CodePush/SSZipArchive/aes/aesopt.h +739 -0
- package/ios/CodePush/SSZipArchive/aes/aestab.c +391 -0
- package/ios/CodePush/SSZipArchive/aes/aestab.h +173 -0
- package/ios/CodePush/SSZipArchive/aes/brg_endian.h +126 -0
- package/ios/CodePush/SSZipArchive/aes/brg_types.h +219 -0
- package/ios/CodePush/SSZipArchive/aes/entropy.c +54 -0
- package/ios/CodePush/SSZipArchive/aes/entropy.h +16 -0
- package/ios/CodePush/SSZipArchive/aes/fileenc.c +144 -0
- package/ios/CodePush/SSZipArchive/aes/fileenc.h +121 -0
- package/ios/CodePush/SSZipArchive/aes/hmac.c +145 -0
- package/ios/CodePush/SSZipArchive/aes/hmac.h +103 -0
- package/ios/CodePush/SSZipArchive/aes/prng.c +155 -0
- package/ios/CodePush/SSZipArchive/aes/prng.h +82 -0
- package/ios/CodePush/SSZipArchive/aes/pwd2key.c +103 -0
- package/ios/CodePush/SSZipArchive/aes/pwd2key.h +57 -0
- package/ios/CodePush/SSZipArchive/aes/sha1.c +258 -0
- package/ios/CodePush/SSZipArchive/aes/sha1.h +73 -0
- package/ios/CodePush/SSZipArchive/minizip/crypt.h +130 -0
- package/ios/CodePush/SSZipArchive/minizip/ioapi.c +369 -0
- package/ios/CodePush/SSZipArchive/minizip/ioapi.h +175 -0
- package/ios/CodePush/SSZipArchive/minizip/mztools.c +284 -0
- package/ios/CodePush/SSZipArchive/minizip/mztools.h +31 -0
- package/ios/CodePush/SSZipArchive/minizip/unzip.c +1839 -0
- package/ios/CodePush/SSZipArchive/minizip/unzip.h +248 -0
- package/ios/CodePush/SSZipArchive/minizip/zip.c +1910 -0
- package/ios/CodePush/SSZipArchive/minizip/zip.h +202 -0
- package/ios/CodePush.xcodeproj/project.pbxproj +937 -0
- package/ios/CodePush.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/CodePush.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/logging.js +6 -0
- package/package-mixins.js +61 -0
- package/package.json +84 -0
- package/react-native.config.js +12 -0
- package/scripts/generateBundledResourcesHash.js +125 -0
- package/scripts/getFilesInFolder.js +19 -0
- package/scripts/recordFilesBeforeBundleCommand.js +41 -0
- package/tsconfig.json +14 -0
- package/tslint.json +32 -0
- package/typings/react-native-code-push.d.ts +589 -0
- package/versioning/BaseVersioning.js +126 -0
- package/versioning/BaseVersioning.test.js +15 -0
- package/versioning/IncrementalVersioning.js +9 -0
- package/versioning/IncrementalVersioning.test.js +186 -0
- package/versioning/SemverVersioning.js +10 -0
- package/versioning/SemverVersioning.test.js +205 -0
- package/versioning/index.js +7 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
### Android
|
|
2
|
+
|
|
3
|
+
> NOTE
|
|
4
|
+
>
|
|
5
|
+
> Complete demo configured with "multi-deployment testing" feature is [here](https://github.com/microsoft/react-native-code-push/files/1314118/rncp1004.zip).
|
|
6
|
+
|
|
7
|
+
The [Android Gradle plugin](https://google.github.io/android-gradle-dsl/current/index.html) allows you to define custom config settings for each "build type" (like debug, release). This mechanism allows you to easily configure your debug builds to use your CodePush staging deployment key and your release builds to use your CodePush production deployment key.
|
|
8
|
+
|
|
9
|
+
*NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` from your terminal.*
|
|
10
|
+
|
|
11
|
+
To set this up, perform the following steps:
|
|
12
|
+
|
|
13
|
+
**For React Native >= v0.60**
|
|
14
|
+
|
|
15
|
+
1. Open the project's app level `build.gradle` file (for example `android/app/build.gradle` in standard React Native projects)
|
|
16
|
+
|
|
17
|
+
2. Find the `android { buildTypes {} }` section and define `resValue` entries for both your `debug` and `release` build types, which reference your `Staging` and `Production` deployment keys respectively.
|
|
18
|
+
|
|
19
|
+
```groovy
|
|
20
|
+
android {
|
|
21
|
+
...
|
|
22
|
+
buildTypes {
|
|
23
|
+
debug {
|
|
24
|
+
...
|
|
25
|
+
// Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
|
|
26
|
+
resValue "string", "CodePushDeploymentKey", '""'
|
|
27
|
+
...
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
releaseStaging {
|
|
31
|
+
...
|
|
32
|
+
resValue "string", "CodePushDeploymentKey", '"<INSERT_STAGING_KEY>"'
|
|
33
|
+
|
|
34
|
+
// Note: It is a good idea to provide matchingFallbacks for the new buildType you create to prevent build issues
|
|
35
|
+
// Add the following line if not already there
|
|
36
|
+
matchingFallbacks = ['release']
|
|
37
|
+
...
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
release {
|
|
41
|
+
...
|
|
42
|
+
resValue "string", "CodePushDeploymentKey", '"<INSERT_PRODUCTION_KEY>"'
|
|
43
|
+
...
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
...
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
*NOTE: Remember to remove the key from `strings.xml` if you are configuring the deployment key in the build process*
|
|
51
|
+
|
|
52
|
+
*NOTE: The naming convention for `releaseStaging` is significant due to [this line](https://github.com/facebook/react-native/blob/e083f9a139b3f8c5552528f8f8018529ef3193b9/react.gradle#L79).*
|
|
53
|
+
|
|
54
|
+
**For React Native v0.29 - v0.59**
|
|
55
|
+
|
|
56
|
+
1. Open up your `MainApplication.java` file and make the following changes:
|
|
57
|
+
|
|
58
|
+
```java
|
|
59
|
+
@Override
|
|
60
|
+
protected List<ReactPackage> getPackages() {
|
|
61
|
+
return Arrays.<ReactPackage>asList(
|
|
62
|
+
...
|
|
63
|
+
new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG), // Add/change this line.
|
|
64
|
+
...
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
2. Open your app's `build.gradle` file (for example `android/app/build.gradle` in standard React Native projects)
|
|
70
|
+
|
|
71
|
+
3. Find the `android { buildTypes {} }` section and define `buildConfigField` entries for both your `debug` and `release` build types, which reference your `Staging` and `Production` deployment keys respectively. If you prefer, you can define the key literals in your `gradle.properties` file, and then reference them here. Either way will work, and it's just a matter of personal preference.
|
|
72
|
+
|
|
73
|
+
```groovy
|
|
74
|
+
android {
|
|
75
|
+
...
|
|
76
|
+
buildTypes {
|
|
77
|
+
debug {
|
|
78
|
+
...
|
|
79
|
+
// Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
|
|
80
|
+
buildConfigField "String", "CODEPUSH_KEY", '""'
|
|
81
|
+
...
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
releaseStaging {
|
|
85
|
+
...
|
|
86
|
+
buildConfigField "String", "CODEPUSH_KEY", '"<INSERT_STAGING_KEY>"'
|
|
87
|
+
// Note: It is a good idea to provide matchingFallbacks for the new buildType you create to prevent build issues
|
|
88
|
+
// Add the following line if not already there
|
|
89
|
+
matchingFallbacks = ['release']
|
|
90
|
+
...
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
release {
|
|
94
|
+
...
|
|
95
|
+
buildConfigField "String", "CODEPUSH_KEY", '"<INSERT_PRODUCTION_KEY>"'
|
|
96
|
+
...
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
...
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
*NOTE: The naming convention for `releaseStaging` is significant due to [this line](https://github.com/facebook/react-native/blob/e083f9a139b3f8c5552528f8f8018529ef3193b9/react.gradle#L79).*
|
|
104
|
+
|
|
105
|
+
4. Pass the deployment key to the `CodePush` constructor via the build config you defined, as opposed to a string literal.
|
|
106
|
+
|
|
107
|
+
**For React Native v0.19 - v0.28**
|
|
108
|
+
|
|
109
|
+
Open up your `MainActivity.java` file and make the following changes:
|
|
110
|
+
|
|
111
|
+
```java
|
|
112
|
+
@Override
|
|
113
|
+
protected List<ReactPackage> getPackages() {
|
|
114
|
+
return Arrays.<ReactPackage>asList(
|
|
115
|
+
...
|
|
116
|
+
new CodePush(BuildConfig.CODEPUSH_KEY, this, BuildConfig.DEBUG), // Add/change this line.
|
|
117
|
+
...
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
*Note: If you gave your build setting a different name in your Gradle file, simply make sure to reflect that in your Java code.*
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
*NOTE: By default, the `react-native run-android` command builds and deploys the debug version of your app, so if you want to test out a release/production build, simply run `react-native run-android --variant release. Refer to the [React Native docs](http://facebook.github.io/react-native/docs/signed-apk-android.html#conten) for details about how to configure and create release builds for your Android apps.*
|
|
127
|
+
|
|
128
|
+
If you want to be able to install both debug and release builds simultaneously on the same device (highly recommended!), then you need to ensure that your debug build has a unique identity and icon from your release build. Otherwise, neither the OS nor you will be able to differentiate between the two. You can achieve this by performing the following steps:
|
|
129
|
+
|
|
130
|
+
1. In your `build.gradle` file, specify the [`applicationIdSuffix`](http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.BuildType.html#com.android.build.gradle.internal.dsl.BuildType:applicationIdSuffix) field for your debug build type, which gives your debug build a unique identity for the OS (like `com.foo` vs. `com.foo.debug`).
|
|
131
|
+
|
|
132
|
+
```groovy
|
|
133
|
+
buildTypes {
|
|
134
|
+
debug {
|
|
135
|
+
applicationIdSuffix ".debug"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
2. Create the `app/src/debug/res` directory structure in your app, which allows overriding resources (like strings, icons, layouts) for your debug builds
|
|
141
|
+
|
|
142
|
+
3. Create a `values` directory underneath the debug res directory created in #2, and copy the existing `strings.xml` file from the `app/src/main/res/values` directory
|
|
143
|
+
|
|
144
|
+
4. Open up the new debug `strings.xml` file and change the `<string name="app_name">` element's value to something else (like `foo-debug`). This ensures that your debug build now has a distinct display name, so that you can differentiate it from your release build.
|
|
145
|
+
|
|
146
|
+
5. Optionally, create "mirrored" directories in the `app/src/debug/res` directory for all of your app's icons that you want to change for your debug build. This part isn't technically critical, but it can make it easier to quickly spot your debug builds on a device if its icon is noticeable different.
|
|
147
|
+
|
|
148
|
+
And that's it! View [here](http://tools.android.com/tech-docs/new-build-system/resource-merging) for more details on how resource merging works in Android.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
### iOS
|
|
2
|
+
|
|
3
|
+
> NOTE
|
|
4
|
+
>
|
|
5
|
+
> Complete demos configured with "multi-deployment testing" feature are [here]:
|
|
6
|
+
> * **without using cocoa pods**: [link](https://github.com/microsoft/react-native-code-push/files/1259957/rncp976.copy.zip)
|
|
7
|
+
> * **using cocoa pods**: [link](https://github.com/microsoft/react-native-code-push/files/1172217/rncp893.copy.zip)
|
|
8
|
+
|
|
9
|
+
Xcode allows you to define custom build settings for each "configuration" (like debug, release), which can then be referenced as the value of keys within the `Info.plist` file (like the `CodePushDeploymentKey` setting). This mechanism allows you to easily configure your builds to produce binaries, which are configured to synchronize with different CodePush deployments.
|
|
10
|
+
|
|
11
|
+
To set this up, perform the following steps:
|
|
12
|
+
|
|
13
|
+
1. Open up your Xcode project and select your project in the `Project navigator` window
|
|
14
|
+
|
|
15
|
+
2. Ensure the project node is selected, as opposed to one of your targets
|
|
16
|
+
|
|
17
|
+
3. Select the `Info` tab
|
|
18
|
+
|
|
19
|
+
4. Click the `+` button within the `Configurations` section and select `Duplicate "Release" Configuration`
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
5. Name the new configuration `Staging` (or whatever you prefer)
|
|
24
|
+
|
|
25
|
+
6. Select the `Build Settings` tab
|
|
26
|
+
|
|
27
|
+
7. Click the `+` button on the toolbar and select `Add User-Defined Setting`
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
Name this new setting something like `Multi_Deployment_Config`. Go to the setting and add value `$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)` for Release. After that add value `$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)` for Staging
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
*NOTE: For Xcode 10 and lower version: Go to Build Location -> Per-configuration Build Products Path -> Staging and change Staging value from $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)*
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
*NOTE: Due to https://github.com/facebook/react-native/issues/11813, we have to do this step to make it possible to use other configurations than Debug or Release on RN 0.40.0 or higher.*
|
|
40
|
+
|
|
41
|
+
8. Click the `+` button again on the toolbar and select `Add User-Defined Setting`
|
|
42
|
+
|
|
43
|
+
Name this new setting something like `CODEPUSH_KEY`, expand it, and specify your `Staging` deployment key for the `Staging` config and your `Production` deployment key for the `Release` config.
|
|
44
|
+
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
*NOTE: As a reminder, you can retrieve these keys by running `appcenter codepush deployment list -a <ownerName>/<appName> -k` from your terminal.*
|
|
48
|
+
|
|
49
|
+
9. Open your project's `Info.plist` file and change the value of your `CodePushDeploymentKey` entry to `$(CODEPUSH_KEY)`
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
And that's it! Now when you run or build your app, your staging builds will automatically be configured to sync with your `Staging` deployment, and your release builds will be configured to sync with your `Production` deployment.
|
|
54
|
+
|
|
55
|
+
*NOTE: CocoaPods users may need to run `pod install` before building with their new release configuration.*
|
|
56
|
+
|
|
57
|
+
*Note: If you encounter the error message `ld: library not found for ...`, please consult [this issue](https://github.com/microsoft/react-native-code-push/issues/426) for a possible solution.*
|
|
58
|
+
|
|
59
|
+
Additionally, if you want to give them seperate names and/or icons, you can modify the `Product Bundle Identifier`, `Product Name` and `Asset Catalog App Icon Set Name` build settings, which will allow your staging builds to be distinguishable from release builds when installed on the same device.
|