@adplorg/capacitor-in-app-purchase
v2.0.64
Published
Capacitor plugin for In App Purchase
Downloads
479
Readme
@adplorg/capacitor-in-app-purchase
Capacitor plugin for In App Purchase
Install
npm install @adplorg/capacitor-in-app-purchase
npx cap syncAPI
getCountryCode()getActiveSubscriptions()getProduct(...)getProducts(...)purchaseProduct(...)purchaseSubscription(...)manageSubscriptions(...)addListener('transaction', ...)- Interfaces
getCountryCode()
getCountryCode() => Promise<{ countryCode: string; }>Returns: Promise<{ countryCode: string; }>
getActiveSubscriptions()
getActiveSubscriptions() => Promise<{ subscriptions: string[]; }>Returns: Promise<{ subscriptions: string[]; }>
getProduct(...)
getProduct(options: { productId: string; }) => Promise<{ product: Product; }>| Param | Type |
| ------------- | ----------------------------------- |
| options | { productId: string; } |
Returns: Promise<{ product: Product; }>
getProducts(...)
getProducts(options: { productIds: string[]; }) => Promise<{ products: Product[]; }>| Param | Type |
| ------------- | -------------------------------------- |
| options | { productIds: string[]; } |
Returns: Promise<{ products: Product[]; }>
purchaseProduct(...)
purchaseProduct(options: { productId: string; referenceUUID: string; }) => Promise<{ transaction: string; }>| Param | Type |
| ------------- | ---------------------------------------------------------- |
| options | { productId: string; referenceUUID: string; } |
Returns: Promise<{ transaction: string; }>
purchaseSubscription(...)
purchaseSubscription(options: { productId: string; referenceUUID: string; offerToken?: string; }) => Promise<{ transaction: string; }>| Param | Type |
| ------------- | ------------------------------------------------------------------------------- |
| options | { productId: string; referenceUUID: string; offerToken?: string; } |
Returns: Promise<{ transaction: string; }>
manageSubscriptions(...)
manageSubscriptions(options: { subscriptionGroupId?: string; }) => Promise<void>| Param | Type |
| ------------- | ---------------------------------------------- |
| options | { subscriptionGroupId?: string; } |
addListener('transaction', ...)
addListener(eventName: 'transaction', listenerFunc: (event: TransactionEvent) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | --------------------------------------------------------------------------------- |
| eventName | 'transaction' |
| listenerFunc | (event: TransactionEvent) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
Product
| Prop | Type |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id | string |
| type | string |
| displayName | string |
| description | string |
| displayPrice | string |
| priceInMicros | number |
| currencyCode | string |
| isSubscriptionGroupEntitled | boolean |
| subscriptionPeriod | { numberOfUnits: number; unit: string; } |
| subscriptionGroup | { id: string; displayName: string; } |
| basePlans | { id: string; offerToken: string; displayPrice: string; priceInMicros: number; currencyCode: string; subscriptionPeriod: { numberOfUnits: number; unit: string; }; }[] |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
TransactionEvent
| Prop | Type |
| ----------------- | --------------------------------- |
| type | 'error' | 'success' |
| transaction | string |
| message | string |
