You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adding platform-specific features or integrations
95
95
96
-
These changes affect compiled native code, so they must go through the App Store or Play Store.
96
+
These changes affect compiled native code, so they must go through the App Store or Play Store.
97
97
98
+
### Delta updates
99
+
100
+
CodePush uses delta updates (file-level diffs) for each release and delivers only the JavaScript files and assets that changed.
101
+
102
+
Instead of redownloading a complete bundle and all static assets on every update, users receive a smaller delta package. This keeps OTA updates faster and reduces bandwidth usage.
98
103
99
104
## How the update flow works
100
105
@@ -113,6 +118,21 @@ The update replaces the previously installed JavaScript bundle while keeping the
113
118
114
119
If an update fails or causes the app to crash on startup before it is marked as successful, the client can automatically revert to the previous working bundle.
115
120
121
+
### Prerequisite: a native build with the SDK
122
+
123
+
Because CodePush relies on the client SDK to check the server, download bundles, and swap the JS layer at launch, **the SDK must already be present in the native binary running on each user's device**. A store build that does not include the SDK cannot install OTA updates — `release-react` will still publish the bundle, but no client will pick it up.
124
+
125
+
The first time you add CodePush to an existing app, you therefore need to:
126
+
127
+
1. Integrate the SDK in your React Native project (see [Setup](/rn-codepush/setup/)).
128
+
2. Produce a native build that includes the SDK and the deployment key you want to target.
129
+
3. Install that build on the devices you expect to receive updates — local dev machines or QA devices for **Staging**, App Store / Google Play for **Production**.
130
+
4. Only then start shipping JS changes to that deployment as OTA updates.
131
+
132
+
For Staging validation this usually just means running a fresh debug build on a test device; no store release is required. For Production, end users must actually update to the new store binary before they can receive anything CodePush publishes.
133
+
134
+
After that, the usual pattern — occasional native releases for native changes, OTA releases for everything else — applies.
135
+
116
136
## Deployment model
117
137
118
138
CodePush organizes updates using **apps** and **deployments**.
Copy file name to clipboardExpand all lines: content/rn-codepush/releasing-updates.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ Think of this as a single pipeline with two decision points:
85
85
86
86
CodePush delivers only JavaScript runtime assets and the files required by the application’s JS layer.
87
87
88
-
A typical update includes:
88
+
A typical update includes only changed files and assets, such as:
89
89
90
90
* JavaScript bundle
91
91
* Static assets (images, fonts, etc.)
@@ -95,6 +95,12 @@ CodePush does not include native binaries such as **.apk** or **.ipa** files. OT
95
95
96
96
Any modification involving native code (e.g. Swift, Objective-C, Java, Kotlin, or native modules) must be released through the App Store or Google Play.
97
97
98
+
### Delta updates
99
+
100
+
CodePush uses delta updates (file-level diffs) for each release and delivers only the files or assets that changed.
101
+
102
+
This means users download a lightweight delta package instead of the full JavaScript bundle and all assets every time, resulting in faster updates and smaller downloads for users.
103
+
98
104
## Version control
99
105
100
106
CodePush uses a two-layer versioning model that separates native app versions from JavaScript update versions. This ensures updates are only delivered to compatible app binaries while still allowing fast OTA iteration.
Copy file name to clipboardExpand all lines: content/rn-codepush/setup.md
+39-8Lines changed: 39 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,45 @@ function App() {
176
176
export default codePush(App);
177
177
{{< /highlight >}}
178
178
179
-
This enables the SDK to automatically check for updates on app start (or based on your chosen update strategy).
179
+
This enables the SDK to automatically check for updates on app start (or based on your chosen update strategy). By default, CodePush looks for updates each time the app launches. When an update is found, it downloads it quietly in the background and applies it the next time the app restarts, whether triggered by the user or the operating system. If you want your app to detect updates faster, you can configure it to sync with the CodePush server whenever the app returns from the background:
Alternatively, if you need more precise control over when update checks occur—such as after a button tap or at scheduled intervals—you can invoke CodePush.sync() whenever needed with your preferred SyncOptions. You can also disable CodePush’s automatic update checks by setting the checkFrequency to manual:
192
+
193
+
{{< highlight bash "style=paraiso-dark">}}
194
+
let codePushOptions = { checkFrequency: codePush.CheckFrequency.MANUAL };
195
+
196
+
class MyApp extends Component {
197
+
onButtonPress() {
198
+
codePush.sync({
199
+
updateDialog: true,
200
+
installMode: codePush.InstallMode.IMMEDIATE,
201
+
});
202
+
}
203
+
204
+
render() {
205
+
return (
206
+
<View>
207
+
<TouchableOpacityonPress={this.onButtonPress}>
208
+
<Text>Check for updates</Text>
209
+
</TouchableOpacity>
210
+
</View>
211
+
);
212
+
}
213
+
}
214
+
215
+
MyApp = codePush(codePushOptions)(App);
216
+
217
+
{{< /highlight >}}
180
218
181
219
### CodePush iOS Setup (React Native)
182
220
@@ -346,13 +384,6 @@ This single command:
346
384
347
385
For the full release workflow, see [Releasing updates](/rn-codepush/releasing-updates/).
348
386
349
-
✅ Best Practices
350
-
* Use Environment Variables – Avoid hardcoding deployment keys.
351
-
* Separate Staging and Production Keys – Always validate updates in Staging before promoting to Production.
352
-
* Confirm Connectivity – After configuration, make sure the app can fetch updates from the server by testing a Staging release.
353
-
354
-
Properly configuring the server URL and deployment keys ensures that CodePush can deliver OTA updates reliably and safely for each platform.
355
-
356
387
## Next steps
357
388
358
389
After completing setup, use the following sections to continue:
Copy file name to clipboardExpand all lines: content/yaml-quick-start/building-a-react-native-app.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -274,6 +274,11 @@ If you are going to publish your app to App Store Connect or Google Play, each u
274
274
{{< include "/partials/publishing-android-ios.md" >}}
275
275
276
276
277
+
## OTA Updates with CodePush
278
+
279
+
Our hosted CodePush service lets you publish OTA updates for React Native projects directly to users' devices, without going through the App Store or Google Play. Read the [concepts page](../rn-codepush/codepush-concepts/) for how it works, or the [setup page](../rn-codepush/setup-codepush/) to get started.
280
+
281
+
277
282
## Conclusion
278
283
Having followed all of the above steps, you now have a working `codemagic.yaml` file that allows you to build, code sign, automatically version and publish your project using Codemagic CI/CD.
279
284
Save your work, commit the changes to the repository, open the app in the Codemagic UI and start the build to see it in action.
0 commit comments