0.0.58 • Published 4 days ago

@capgo/native-purchases v0.0.58

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

native-purchases

In-app Purchases Made Easy

Install

npm install native-purchases
npx cap sync

Android

Add this to manifest

<uses-permission android:name="com.android.vending.BILLING" />

API

restorePurchases()

restorePurchases() => any

Restores a user's previous and links their appUserIDs to any user's also using those .

Returns: any


purchaseProduct(...)

purchaseProduct(options: { productIdentifier: string; planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; }) => any

Started purchase process for the given product.

ParamTypeDescription
options{ productIdentifier: string; planIdentifier?: string; productType?: PURCHASE_TYPE; quantity?: number; }- The product to purchase

Returns: any


getProducts(...)

getProducts(options: { productIdentifiers: string[]; planIdentifier?: string; productType?: PURCHASE_TYPE; }) => any

Gets the product info associated with a list of product identifiers.

ParamTypeDescription
options{ productIdentifiers: {}; planIdentifier?: string; productType?: PURCHASE_TYPE; }- The product identifiers you wish to retrieve information for

Returns: any


isBillingSupported()

isBillingSupported() => any

Check if billing is supported for the current device.

Returns: any


getPluginVersion()

getPluginVersion() => any

Get the native Capacitor plugin version

Returns: any


Interfaces

CustomerInfo

PropTypeDescription
activeSubscriptionsstringSet of active subscription skus
allPurchasedProductIdentifiersstringSet of purchased skus, active and inactive
nonSubscriptionTransactions{}Returns all the non-subscription a user has made. The are ordered by purchase date in ascending order.
latestExpirationDatestring | nullThe latest expiration date of all purchased skus
firstSeenstringThe date this user was first seen in RevenueCat.
originalAppUserIdstringThe original App User Id recorded for this user.
requestDatestringDate when this info was requested
originalApplicationVersionstring | nullReturns the version number for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. This corresponds to the value of CFBundleVersion (in iOS) in the Info.plist file when the purchase was originally made. This is always null in Android
originalPurchaseDatestring | nullReturns the purchase date for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions.
managementURLstring | nullURL to manage the active subscription of the user. If this user has an active iOS subscription, this will point to the App Store, if the user has an active Play Store subscription it will point there. If there are no active subscriptions it will be null. If there are multiple for different platforms, it will point to the device store.

Transaction

PropTypeDescription
transactionIdstringRevenueCat Id associated to the transaction.

Product

PropTypeDescription
identifierstringProduct Id.
descriptionstringDescription of the product.
titlestringTitle of the product.
pricenumberPrice of the product in the local currency.
priceStringstringFormatted price of the item, including its currency sign, such as €3.99.
currencyCodestringCurrency code for price and original price.
currencySymbolstringCurrency symbol for price and original price.
isFamilyShareablebooleanBoolean indicating if the product is sharable with family
subscriptionGroupIdentifierstringGroup identifier for the product.
subscriptionPeriodSubscriptionPeriodThe Product subcription group identifier.
introductoryPriceSKProductDiscount | nullThe Product introductory Price.
discounts{}The Product discounts list.

SubscriptionPeriod

PropTypeDescription
numberOfUnitsnumberThe Subscription Period number of unit.
unitnumberThe Subscription Period unit.

SKProductDiscount

PropTypeDescription
identifierstringThe Product discount identifier.
typenumberThe Product discount type.
pricenumberThe Product discount price.
priceStringstringFormatted price of the item, including its currency sign, such as €3.99.
currencySymbolstringThe Product discount currency symbol.
currencyCodestringThe Product discount currency code.
paymentModenumberThe Product discount paymentMode.
numberOfPeriodsnumberThe Product discount number Of Periods.
subscriptionPeriodSubscriptionPeriodThe Product discount subscription period.

Enums

PURCHASE_TYPE

MembersValueDescription
INAPP"inapp"A type of SKU for in-app products.
SUBS"subs"A type of SKU for subscriptions.
0.0.58

4 days ago

0.0.57

11 days ago

0.0.56

18 days ago

0.0.55

18 days ago

0.0.54

25 days ago

0.0.53

1 month ago

0.0.52

7 months ago

0.0.51

7 months ago

0.0.50

8 months ago

0.0.49

8 months ago

0.0.48

8 months ago

0.0.47

8 months ago

0.0.46

8 months ago

0.0.45

8 months ago

0.0.44

8 months ago

0.0.43

8 months ago

0.0.41

8 months ago

0.0.40

8 months ago

0.0.39

8 months ago

0.0.38

8 months ago

0.0.37

8 months ago

0.0.36

8 months ago

0.0.35

8 months ago

0.0.34

8 months ago

0.0.33

8 months ago

0.0.31

8 months ago

0.0.30

8 months ago

0.0.29

8 months ago

0.0.28

8 months ago

0.0.26

8 months ago

0.0.25

9 months ago

0.0.24

9 months ago

0.0.23

9 months ago

0.0.21

9 months ago

0.0.22

9 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.18

9 months ago

0.0.17

9 months ago

0.0.16

9 months ago

0.0.15

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago