0.0.1 • Published 9 months ago

native-purchases v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

native-purchases

In-app Subscriptions Made Easy

Install

npm install native-purchases
npx cap sync

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; quantity: number; }) => any
ParamType
options{ productIdentifier: string; quantity: number; }

Returns: any


getProducts(...)

getProducts(options: { productIdentifiers: string[]; }) => any
ParamType
options{ productIdentifiers: {}; }

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
transactionIdentifierstringRevenueCat Id associated to the transaction.
productIdentifierstringProduct Id associated with the transaction.
purchaseDatestringPurchase date of the transaction in ISO 8601 format.

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.
0.0.1

9 months ago