Skip to main content

SDK Installation

After this guide, your app will be connected to SwiftPatch and ready for OTA updates.

Prerequisites
DependencyMinimum Version
React Native0.76.0+
React18.2.0+
iOS13.4+
Android SDK24+ (Android 7.0)
Node.js18.0.0+

You also need a SwiftPatch account with a project created. If you haven't done that yet, follow the Getting Started guide first.

Step 1: Install the Package

npm install @swiftpatch/react-native
Migrating from CodePush?

See Migrating from CodePush for configuration differences.

Step 2: Find Your App ID

  1. Open the SwiftPatch Dashboard.
  2. Go to your project Settings.
  3. Copy the App ID.
warning

Each project has its own App ID. Separate iOS and Android projects have separate IDs.

Step 3: Configure Native Platforms

iOS

3a. Install CocoaPods:

cd ios && pod install && cd ..

3b. Update your AppDelegate. See iOS Setup for step-by-step instructions.

3c. Add your App ID to ios/YourApp/Info.plist:

ios/YourApp/Info.plist
<key>SwiftPatchAppId</key>
<string>YOUR_APP_ID</string>

Android

3a. Update your MainApplication. See Android Setup for step-by-step instructions.

3b. Add your App ID to android/app/src/main/res/values/strings.xml:

android/app/src/main/res/values/strings.xml
<string name="SwiftPatchAppId">YOUR_APP_ID</string>
Using New Architecture?

See New Architecture for additional setup.

Step 4: Wrap Your App

App.tsx
import { withSwiftPatch } from '@swiftpatch/react-native';

function App() {
return <YourApp />;
}

export default withSwiftPatch(App);

The SDK handles update checks, downloads, and installation automatically.

tip

Pass a config object to withSwiftPatch for custom behavior. See Configuration.

Step 5: Verify

npx react-native run-ios
# or
npx react-native run-android

Look for this in your logs:

[SwiftPatch] SDK initialized successfully

You're all set!

Not seeing the log?

Check the Troubleshooting guide.

Next Steps