Quick Start
Go from zero to a live OTA update in five steps. You'll create an account, install the SDK, configure your app, and deploy an update -- no app store review needed.
- React Native 0.76+ with a working project
- Node.js 18+ and npm 9+
- CocoaPods installed (iOS only)
- A release build running on a device or simulator
Follow the React Native environment setup first, then come back.
Step 1: Sign Up and Create Your App
Go to app.swiftpatch.io and create a free account.
- Click + New App.
- Enter your app name.
- Select your platform -- iOS, Android, or both.
- Click Create.
- Open Settings and copy your App ID.
Your App ID looks like app_xxxxxxxxxxxxxxxx. You'll need it in the next step.
Step 2: Install the SDK
npm install @swiftpatch/react-native
iOS -- install CocoaPods dependencies:
cd ios && pod install && cd ..
Android -- no extra setup needed. The SDK auto-links.
Step 3: Configure Your App
You'll edit three things: native config files, native entry points, and your JavaScript entry point.
3a. Add Your App ID
iOS -- ios/YourApp/Info.plist:
<key>SwiftPatchAppId</key>
<string>YOUR_APP_ID</string>
Android -- android/app/src/main/res/values/strings.xml:
<string name="SwiftPatchAppId">YOUR_APP_ID</string>
3b. Point Native Code to SwiftPatch
SwiftPatch needs to control which JavaScript bundle your app loads so it can apply OTA updates.
iOS (Swift -- React Native 0.76+):
import react_native_swiftpatch
@main
class AppDelegate: RCTAppDelegate {
override func bundleURL() -> URL? {
#if DEBUG
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
return SwiftPatchModule.getBundleURL()
#endif
}
}
iOS (Objective-C):
#import "SwiftPatchModule.h"
@implementation AppDelegate
- (NSURL *)bundleURL {
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [SwiftPatchModule getBundleURL];
#endif
}
@end
Android:
import com.swiftpatch.SwiftPatchModule
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getJSBundleFile(): String? {
return SwiftPatchModule.getJSBundleFile(applicationContext)
?: super.getJSBundleFile()
}
}
}
3c. Wrap Your App
import { withSwiftPatch } from '@swiftpatch/react-native';
function App() {
return <YourApp />;
}
export default withSwiftPatch(App);
Verify the SDK
Run your app in release mode:
npx react-native run-ios --mode Release
Look for this in the logs:
[SwiftPatch] SDK initialized successfully
The SDK only fetches OTA updates in release builds. In debug mode, your app uses Metro as usual.
Step 4: Deploy Your First Update
Make a visible change, then push it over the air.
4a. Edit Some Text
function HomeScreen() {
return (
<View>
<Text>Hello from SwiftPatch! OTA is working.</Text>
</View>
);
}
4b. Install the CLI and Deploy
npm install -g @swiftpatch/cli
swiftpatch login
swiftpatch deploy -p ios --hermes -n "My first OTA update"
--hermes if your app uses HermesReact Native 0.70+ enables Hermes by default. Deploying without --hermes causes a crash loop.
Step 5: Verify the Update
- Kill the app completely.
- Reopen it -- the SDK downloads the update.
- Kill and reopen once more. You should see your updated text.
By default, SwiftPatch applies updates on the next launch after download. The first open downloads; the second loads the new code. You can change this in the SDK configuration.
Troubleshooting
| Symptom | Solution |
|---|---|
No SDK initialized log | Check that SwiftPatchAppId is set in Info.plist / strings.xml and matches your dashboard App ID. |
| Update does not appear | Make sure you're running a release build. Debug builds skip OTA updates. |
| App crashes after update | Deploy with --hermes. The SDK auto-rolls back after two crashes within 10 seconds. |
| Version mismatch | The SDK matches on your native binary version exactly. Check MARKETING_VERSION (iOS) or versionName (Android). |
Next Steps
- Installation (detailed) -- Platform-specific setup for Swift, Objective-C, Kotlin, and New Architecture.
- Your First Update -- Deeper walkthrough of the deploy and verify cycle.
- SDK Configuration -- Control update timing, mandatory updates, and custom UI.
- Phased Rollouts -- Release to a small group before going to 100%.
- CI/CD Integration -- Automate deploys with GitHub Actions, CircleCI, or Bitrise.