Infinite Red Jamon Holmgren Sep 20, 2021

How to implement over the air updates with expo-updates in React Native

Article Summary

Jamon Holmgren from Infinite Red walks through implementing expo-updates in a vanilla React Native app—and gets it working in just two hours. No managed Expo workflow required.

Over-the-air updates let you push JavaScript changes to production apps without waiting for app store approval. This detailed guide covers setting up expo-updates as an alternative to Microsoft's CodePush, complete with iOS, Android, and React configuration.

Key Takeaways

Critical Insight

You can add OTA update capabilities to any React Native app using expo-updates, even without a managed Expo workflow, by configuring native code and implementing update checks in JavaScript.

The article hints at advanced topics like release channels, rollbacks, and handling apps multiple versions behind, but leaves those strategies for a future deep dive.

About This Article

Problem

React Native developers faced a problem: pushing JavaScript bundle updates to production apps meant waiting for app store review cycles that could take a week or more. They also needed to keep things compatible with vanilla React Native apps that don't use managed Expo.

Solution

Jamon Holmgren from Infinite Red built expo-updates by setting up EXUpdatesAppController in the native iOS and Android code. On iOS, he added Expo.plist configuration. On Android, he added AndroidManifest metadata. Then he created a useEffect hook that checks for updates every 3 seconds on the welcome screen.

Impact

The whole thing took about two hours to implement. Now developers can deploy OTA updates to existing React Native apps by running `expo publish` and watching bundle hash changes show up on devices. No app store submission needed.