OTA update
- React Native course
- Advanced
- Lesson 77/83
- 5 min
Learn OTA (over-the-air) updates.
What is an OTA update?
An OTA (over-the-air) update sends JavaScript changes to the device without store review. Expo Updates provides this; users get the new JS bundle without reinstalling the app.
OTA works only for JS and asset (image, font) changes. If native code (Gradle, CocoaPods) changes, a new store build is required. The eas update command publishes an update; the expo-updates library pulls it on the device. With channels you can send different bundles to different user groups.
The eas update command
The eas update command publishes an update. You set the channel with --branch and a note with --message. Example: eas update --branch production --message "Bug fix".
On the device the expo-updates library checks the server periodically. If a new bundle exists it downloads it and applies it on the next launch. The updates.enabled field in app.json must be true. While testing you can use --branch staging as a separate channel, then move it to production.
Practice Write the app.json updates section
In an app.json skeleton define the "updates" section. It carries "enabled" set to true and "fallbackToCacheTimeout" set to 0.
Starter code
{
"expo": {
"name": "App"
// add the updates section here
}
}Sample solution
{
"expo": {
"name": "App",
"updates": {
"enabled": true,
"fallbackToCacheTimeout": 0
}
}
}Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which changes cannot OTA send?
eas update --branch production- Native code changes Correct answer
- Text fixes
- Changing the color theme
- Adding a new image
Explanation: Native code changes require a new store build.
2 Match each flow piece to its role
| Term | Meaning |
|---|---|
eas update |
Publishes update |
--branch |
Picks channel |
expo-updates |
Pulls on device |
--message |
Writes a note |
3 Write the updates.enabled field
"updates": { "enabled": ____ }
"updates": { "enabled": true }
Explanation: With updates.enabled true OTA turns on.