RevenueCat

Leverage RevenueCat to power in-app purchases in your app.

Overview

The RevenueCat Plugin simplifies the integration of in-app purchases and subscriptions by leveraging RevenueCat’s backend and SDKs for iOS and Android.

This plugin provides a streamlined approach to fetching products, processing purchases, and restoring past transactions, reducing the complexity of implementing Apple’s StoreKit and Google Play Billing.

👍

Developer Demo

Display our demo page in your app to test during development https://median.dev/revenue-cat

Implementation Guide

SDK Initialization

To use the RevenueCat Plugin, initialize it with your public apiKey and appUserID. References to both can be found in the RevenueCat documentation.

Provide a callback function or return a promise.

↔️Median JavaScript Bridge

median.revenueCat.configure({
  'apiKey': '<my_api_key>', 
  'appUserID': '<my_app_user_id>'
})
// Return value:
{
  "success": true | false
}

Verify SDK Initialization

Ensure that the RevenueCat SDK is initialized before calling other functions.

Provide a callback function or return a promise.

↔️Median JavaScript Bridge

median.revenueCat.isInitialized({'callback': function});
// Return value:
{
  'initialized': true | false,
  'apiKey': STRING // available only if initialized is true
}

Retrieve Offerings

Fetch the list of available in-app products and subscriptions.

Provide a callback function or return a promise.

↔️Median JavaScript Bridge

median.revenueCat.getOfferings()
// Return value:
[ ]

Make a Purchase

Trigger an in-app purchase using the product identifier.

Provide a callback function or return a promise.

↔️Median JavaScript Bridge

median.revenueCat.purchase({'identifier':STRING})
// Return value:
{
  "success": true | false
}

Restore Purchases

Restore a user's previously purchased subscriptions and in-app purchases.

Provide a callback function or return a promise.

↔️Median JavaScript Bridge

median.revenueCat.restorePurchases()
// Return value:
{
  "success": true | false
}