0.1.0 • Published 7 months ago

capacitor-plugin-qonversion v0.1.0

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

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.

ParamType
optionsLaunchOptions

Returns: Promise<Result<LaunchResult>>


setDebugMode()

setDebugMode() => Promise<void>

Set the flag to distinguish sandbox and production users.


identify(...)

identify(options: IdentifyOptions) => Promise<void>
ParamType
optionsIdentifyOptions

logout()

logout() => Promise<void>

setUserProperty(...)

setUserProperty(options: PropertyOptions) => Promise<void>
ParamType
optionsPropertyOptions

storeSDKInfo(...)

storeSDKInfo(options: SDKInfo) => Promise<void>
ParamType
optionsSDKInfo

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.

ParamType
optionsProductIds

Returns: Promise<Result<EligibilityResult[]>>


purchase(...)

purchase(options: ProductId) => Promise<Result<PermissionResult[]>>

Perform a purchase for the product.

ParamType
optionsProductId

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>
ParamType
optionsAttributionData

Returns: Promise<any>


Interfaces

Result

PropType
dataT

LaunchResult

PropType
uidstring
timestampnumber
productsProductResult[]
permissionsPermissionResult[]
userProductsProductResult[]

ProductResult

PropType
idstring
storeIdstring
typenumber
offeringIdstring
durationnumber
trialDurationnumber
storeProductSkuResult
prettyPricestring

SkuResult

PropType
descriptionstring
freeTrialPeriodstring
iconUrlstring
introductoryPricestring
introductoryPriceAmountMicrosnumber
introductoryPriceCyclesnumber
introductoryPricePeriodstring
originalJsonstring
originalPricestring
originalPriceAmountMicrosnumber
pricestring
priceAmountMicrosnumber
priceCurrencyCodestring
skustring
subscriptionPeriodstring
titlestring
typestring
hashCodenumber
toStringstring

PermissionResult

PropType
idstring
associatedProductstring
activeboolean
renewState'NonRenewable' | 'Unknown' | 'WillRenew' | 'Canceled' | 'BillingIssue'
startedTimestampnumber
expirationTimestampnumber
keystring

LaunchOptions

PropType
keystring
observerModeboolean

IdentifyOptions

PropType
userIDstring

PropertyOptions

PropType
keystring
valuestring

SDKInfo

PropType
sourceKeystring
sourcestring
sdkVersionKeystring
sdkVersionstring

EligibilityResult

PropType
productIdstring
statusstring
keystring

ProductIds

PropType
productsstring[]

ProductId

PropType
productIdstring

OfferingResult

PropType
idstring
mainboolean
tagnumber
offeringProductsProductResult[]

AttributionData

PropType
dataany
providerAttributionSource

Enums

AttributionSource

MembersValue
AppsFlyer0
Branch1
Adjust2