Skip to main content


What is RevenueCat?

RevenueCat provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy. With our SDK, you can build and manage your app business on any platform without having to maintain IAP infrastructure. You can read more about how RevenueCat fits into your app or you can sign up free to start building.


cordova plugin add cordova-plugin-purchases --save

Additional iOS Setup

Add In-app Purchase Capability to Project

The In-app Purchase capability isn't required to install the SDK, but it is required to make purchases.

  1. In Xcode, in project manager, select your app target.
  2. Open the Signing and Capabilities tab.
  3. Click the + Capability button and double-click on In-App Purchase.

Add Strip Frameworks Phase if using cordova-plugin-purchases 1.1.0 or lower

The App Store, in its 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/cordova-plugin-purchases/src/ios/" (quotes included)


You have to make sure that the SWIFT_LANGUAGE_VERSION is set if it's not already. cordova-plugin-purchases needs Swift >= 5.0.

You can either set it in the project yourself, or use an external plugin like In order to set it yourself:

  1. In Xcode, in project manager, select your app target.
  2. Open the Build Settings tab
  3. Look for the Swift Language Version setting.
  4. Set it to 5.0.

Import Purchases


The types are shipped inside the npm package. You can import them like this:

import Purchases, {
PurchasesOfferings, // Types for TypeScript
} from 'cordova-plugin-purchases/www/plugin';


Wait for the Platform to be ready, then configure the plugin in your src/app/app.component.ts:

import { Platform } from "@ionic/angular";
// TS typings for the plugin
import Purchases, { LOG_LEVEL } from 'cordova-plugin-purchases/www/plugin';

constructor(platform: Platform) {
platform.ready().then(() => {
Purchases.setLogLevel(LOG_LEVEL.DEBUG); // Enable to get debug logs
apiKey: "my_api_key",
appUserID: "my_app_user_id"


Import the plugin object then use its static methods:

import Purchases, { LOG_LEVEL } from 'cordova-plugin-purchases/www/plugin';

const Tab1: React.FC = () => {
Purchases.setLogLevel(LOG_LEVEL.DEBUG); // Enable to get debug logs
apiKey: "my_api_key",
appUserID: "my_app_user_id"
return (
<IonTitle>My App</IonTitle>
<IonButton onClick={purchasePackage}>Subscribe now</IonButton>

Next Steps