Purchases
Use Qonversion SDK and Qonversion server to work with Apple StoreKit and Google Billing Client fast and secure.
To make purchases with Qonversion SDK you need to create Permissions and Products in Qonversion Product Center dashboard.
Use Qonvesrion.purchase
method to make a purchase. This method validates a user receipt through Qovnersion backend after making a purchase with Apple and unlocks permissions associated with the product. For a successful purchase, permissions
object will contain unlocked entitlements. For a failed purchase, you can get error details from the error
object.
Qonversion.purchase("main") { (permissions, error, cancelled) in
if permissions["premium"]?.isActive == true {
// Flow for users with active permission
}
}
main
is a cross-platform Qonverison product identifier, that you can create in Qonversion Product Center dashboard, read more about products here.
premium
is an example of a permission identifier that you can create in Qonversion Product Center dashboard.
permissions
is a dictionary object with the project's permissions. Any permission includes the following data:
Property name
Type
Description
productID
String
Associated qonversion product identifier, for example "main" that unlocked permission
isActive
Bool
Permission state: true for active and false for locked permission. The state could be active for a canceled subscription that has not expired yet.
renewState
Enum
willRenew
cancelled
billingIssue
startedDate
Date
First transaction date
expirationDate
Date
Permission expiration date, empty for one-time purchases
Last updated
Was this helpful?