capacitor-plugin-qonversion
NB: Code for iOS has not been done for this project yet.
NB: Been away for a year but updates and fixes will resume shortly
Plugin to allow users in-app purchases and subscriptions via the use of Qonversion
Install
npm install capacitor-plugin-qonversion
npx cap sync
API
Here we define the methods in the QonversionPluginPlugin.java
that can be accessed by the application.
launchWithKey(...)
launchWithKey(options: LaunchOptions) => Promise<Result<LaunchResult>>
Launch the Qonversion instance with the provided projectKey, optionally enable observerMode.
| Param | Type |
|---|
options | LaunchOptions |
Returns: Promise<Result<LaunchResult>>
setDebugMode()
setDebugMode() => Promise<void>
Set the flag to distinguish sandbox and production users.
identify(...)
identify(options: IdentifyOptions) => Promise<void>
| Param | Type |
|---|
options | IdentifyOptions |
logout()
logout() => Promise<void>
setUserProperty(...)
setUserProperty(options: PropertyOptions) => Promise<void>
| Param | Type |
|---|
options | PropertyOptions |
storeSDKInfo(...)
storeSDKInfo(options: SDKInfo) => Promise<void>
checkPermissions()
checkPermissions() => Promise<Result<PermissionResult[]>>
Check the user receipt and return all the associated permissions.
Returns: Promise<Result<PermissionResult[]>>
checkTrialIntroEligibilityForProductIds(...)
checkTrialIntroEligibilityForProductIds(options: ProductIds) => Promise<Result<EligibilityResult[]>>
Check if the user is eligible for an introductory offer of the products.
| Param | Type |
|---|
options | ProductIds |
Returns: Promise<Result<EligibilityResult[]>>
purchase(...)
purchase(options: ProductId) => Promise<Result<PermissionResult[]>>
Perform a purchase for the product.
| Param | Type |
|---|
options | ProductId |
Returns: Promise<Result<PermissionResult[]>>
restore()
restore() => Promise<Result<PermissionResult[]>>
Returns: Promise<Result<PermissionResult[]>>
syncPurchases()
syncPurchases() => Promise<void>
experiments()
experiments() => Promise<Result<any[]>>
Returns: Promise<Result<any[]>>
products()
products() => Promise<Result<ProductResult[]>>
Retrieve a list of available products.
Returns: Promise<Result<ProductResult[]>>
offerings()
offerings() => Promise<Result<OfferingResult[]>>
Retrieve a list of available offerings.
Returns: Promise<Result<OfferingResult[]>>
addAttributionData(...)
addAttributionData(options: AttributionData) => Promise<any>
| Param | Type |
|---|
options | AttributionData |
Returns: Promise<any>
Interfaces
Result
LaunchResult
| Prop | Type |
|---|
uid | string |
timestamp | number |
products | ProductResult[] |
permissions | PermissionResult[] |
userProducts | ProductResult[] |
ProductResult
| Prop | Type |
|---|
id | string |
storeId | string |
type | number |
offeringId | string |
duration | number |
trialDuration | number |
storeProduct | SkuResult |
prettyPrice | string |
SkuResult
| Prop | Type |
|---|
description | string |
freeTrialPeriod | string |
iconUrl | string |
introductoryPrice | string |
introductoryPriceAmountMicros | number |
introductoryPriceCycles | number |
introductoryPricePeriod | string |
originalJson | string |
originalPrice | string |
originalPriceAmountMicros | number |
price | string |
priceAmountMicros | number |
priceCurrencyCode | string |
sku | string |
subscriptionPeriod | string |
title | string |
type | string |
hashCode | number |
toString | string |
PermissionResult
| Prop | Type |
|---|
id | string |
associatedProduct | string |
active | boolean |
renewState | 'NonRenewable' | 'Unknown' | 'WillRenew' | 'Canceled' | 'BillingIssue' |
startedTimestamp | number |
expirationTimestamp | number |
key | string |
LaunchOptions
| Prop | Type |
|---|
key | string |
observerMode | boolean |
IdentifyOptions
PropertyOptions
| Prop | Type |
|---|
key | string |
value | string |
SDKInfo
| Prop | Type |
|---|
sourceKey | string |
source | string |
sdkVersionKey | string |
sdkVersion | string |
EligibilityResult
| Prop | Type |
|---|
productId | string |
status | string |
key | string |
ProductIds
ProductId
OfferingResult
| Prop | Type |
|---|
id | string |
main | boolean |
tag | number |
offeringProducts | ProductResult[] |
AttributionData
| Prop | Type |
|---|
data | any |
provider | AttributionSource |
Enums
AttributionSource
| Members | Value |
|---|
AppsFlyer | 0 |
Branch | 1 |
Adjust | 2 |