0.4.0 • Published 2 years ago

react-native-purchase-kit v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

It's built on top of the latest StoreKit 2 and Android Billing Library 3.0.0+ (coming soon). At the moment, it only supports subscriptions and there is a single API for both platforms. Check out below.

Installation

Requires iOS 15+ and Android minSdkVersion = 24.

yarn add react-native-purchase-kit

Basic Usage

Configure app to use StoreKit 2 and Android Billing Library 3.0.0+.

import PurchaseKit from 'react-native-purchase-kit';

const kit = new PurchaseKit();

// Get products
const products = await kit.getProducts(['monthly_subscription']);

// Buy a product
const transaction = await kit.purchase({
  productID: 'monthly_subscription',
  uuid: 'uuid',
});

// Get recent transactions
kit.getRecentTransactions();

// Get receipt
const receipt = await kit.readReceipt();

// Listen to events
kit.addListener('transactions', (event) => {
  if (event.kind === 'transactions') {
    console.log(event.transaction);
  }
});

License

MIT

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago