In this lesson, you will learn how to bypass the traditional app store review process to ship urgent bug fixes and minor features directly to your users' devices.
The Architecture of a Patch
In a standard React Native app, your code consists of two distinct parts: the Native Binary (the compiled code written in Swift, Kotlin, or C++) and the JavaScript Bundle (your logic, components, and styles).
When you build your app for the App Store or Google Play, these two parts are zipped together. Normally, if you find a bug in your JavaScript logic, you would have to submit a new version of the app to the stores and wait for a review. However, because React Native is essentially a bridge, the native side is just a host for your JavaScript code.
How Over-the-Air (OTA) Updates Work
An Over-the-Air update works by decoupling your JavaScript bundle from the native binary. When the app launches, it doesn't just look for the bundle included inside the binary; it can "phone home" to a server to see if a newer version of that bundle exists.
- The Request: Upon startup, the app asks, "Is there a new JavaScript bundle available for this specific app version?"
- The Download: If a newer bundle exists, the app downloads it into its local storage.
- The Swap: The next time the user restarts the app, the native loader loads this new file instead of the original one that came with the app.
Here is a conceptual look at how the app might decide which bundle to run:
// A conceptual look at the bundle loader
const bundleToLoad = await fetchUpdateManifest();
if (bundleToLoad.isNewer) {
loadBundleFromStorage(bundleToLoad.path);
} else {
loadBundleFromDisk(localBinaryBundlePath);
}
Because you are only replacing the JavaScript code, you cannot change native code (like adding a new camera permission or updating the app icon) via OTA updates. If your change touches the "Native Module Proxy System" or involves changing native binary headers, you must go through the standard store update process.
Key Takeaway: Over-the-air updates allow you to patch your JavaScript logic remotely, turning your app into a living, updateable project that avoids the slow cycle of platform store approvals.