Build With RevenueCat

Build a customized mobile subscription business with RevenueCat. We do the heavy lifting of normalizing subscribers from any source and maintain a single source of truth for subscription status, so you can get back to building your app.

RevenueCat is a powerful, secure, reliable, and free to use in-app purchase server with global support. All you need to get started is an API key.

React Native

Instructions for installing Purchases SDK for React Native


Purchases for React Native can be installed either via npm or yarn.

npm install --save react-native-purchases
yarn add react-native-purchases

After that, you should link the library to the native projects by doing:

react-native link react-native-purchases

Additional iOS Setup

Purchases.framework also needs to be added to your iOS project. The npm install will download the correct framework version and the link command will add libRNPurchases.a to the Linked Frameworks and Libraries of your app target in the iOS project.

Alternatively, you can install the framework via CocoaPods.

1. Create a Framework Reference in your project

  1. Drag Purchases.framework from the RNPurchasessub-project under the libraries section to the outer project and create a reference

2. Add iOS Framework to Embedded Binaries

  1. In Xcode, in project manager, select your app target.
  2. Select the general tab
  3. Drag Purchases.framework from your project to the Embedded Binaries section

  1. Add $(PROJECT_DIR)/../node_modules/react-native-purchases/ios to Framework Search paths in build settings

3. Add Strip Frameworks Phase

The App Store, in it's infinite wisdom, still rejects fat frameworks, so we need to strip our framework before it is deployed. To do this, add the following script phase to your build.

  1. In Xcode, in project manager, select your app target.
  2. Open the Build Phases tab
  3. Add a new Run Script, name it Strip Frameworks
  4. Add the following command "${PROJECT_DIR}/../node_modules/react-native-purchases/ios/" (quotes included)

4. Link static library

The react-native link command should have added the libRNPurchases.a library to the Linked Frameworks and Libraries section of your app target. If it hasn't add it like this:

Import Purchases

You should now be able to import Purchases

import Purchases from 'react-native-purchases';

Include BILLING permission for Android projects

Don't forget to include the BILLING permission in your AndroidManifest.xml file

<uses-permission android:name="" />

ExpoKit special instructions

The latest Purchases SDK version compatible with ExpoKit apps is 2.0.1. In order to use Purchases with ExpoKit apps add the following dependency to your package.json.

"react-native-purchases": "2.0.1"

Next Steps

React Native

Instructions for installing Purchases SDK for React Native

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.