Skip to main content

Overview

The Encore React Native SDK is published as the public @encorekit/react-native package on npm. The package includes native bridges for both iOS and Android, so updating is a two-part flow: bump the npm package, then refresh the native iOS pods so the updated iOS SDK is picked up. Android is resolved automatically on the next build.

Check the Current and Latest Version

Your installed version is recorded in package.json and locked in your lockfile (package-lock.json or yarn.lock). The latest published version is listed on the package’s npm page. You can also check from the command line:
npm view @encorekit/react-native version
To see whether your project is behind:
npm outdated @encorekit/react-native

Update the Package

1

Update to the latest version

Install the latest release with your package manager:
npm install @encorekit/react-native@latest
yarn add @encorekit/react-native@latest
2

Refresh the native iOS pods

Run pod install with --repo-update so CocoaPods fetches the newest spec and installs the updated native iOS dependency:
cd ios && pod install --repo-update && cd ..
Android requires no separate step — React Native auto-links the updated native module, and Gradle resolves it automatically on your next build.
3

Rebuild both platforms

Build fresh so the updated JavaScript and native layers are compiled in:
npx react-native run-ios
npx react-native run-android

Verify the Update

Confirm the installed version matches the latest release:
npm outdated @encorekit/react-native
@encorekit/react-native should no longer appear as outdated.

Updating to 1.1.42 or Later — Signal the Purchase Outcome

One-time migration check for subscription managers. If you use a subscription manager (RevenueCat, react-native-iap, or your own billing), your onPurchaseRequest handler must call Encore.completePurchaseRequest(success) with a boolean in every code path — both success and failure. If you don’t, the SDK stays locked and cannot present future offers until the app restarts. Integrations created on 1.1.42 or later already do this, so this check only applies when migrating an older integration.
Pass true when the purchase succeeds and false when it fails or is cancelled — always inside a try/catch so both paths are covered. For example, with RevenueCat:
const unsubscribe = Encore.onPurchaseRequest(async ({ productId }) => {
  try {
    const { customerInfo } = await Purchases.purchaseProduct(productId);
    await Encore.completePurchaseRequest(true);
  } catch (error) {
    await Encore.completePurchaseRequest(false);
  }
});
See onPurchaseRequest() and completePurchaseRequest() for react-native-iap and custom examples.
If you encounter issues after updating, reach out to admin@joinyaw.com.