Skip to main content
Qonversion SDK provides flexible cross-platform in-app purchase management for your app. You don’t need to save App Stores product IDs and respective prices on the client side. To manage in-app products promoted in your app from the Qonversion dashboard, you need to configure Products, Entitlements and Offerings in Qonversion. Once you have everything configured, Qonversion provides two ways of displaying products: We strongly recommend using Qonversion Offerings. This allows you to:
  • Change products offered to your users without app release
  • Run A/B tests

Local cache

Qonversion SDK caches the data on products, offerings, and entitlements. This data is available when the internet connection is lost or there are server-side delays. Every time your application launches, SDK requests actual SkProduct/SkuDetails from the App Store or Google Play to get the most up-to-date product data.

Displaying Products

Use the offerings method to get the wrapper object Offerings:
Qonversion.shared().offerings { (offerings, error) in
  if let products = offerings?.main?.products {
    // Display products for sale
  }
}
The products are listed in the same order as they were added to the Qonversion Offerings settings. Additionally, in the the same settings, you can mark an offering as a main. That allows you to avoid keeping the Offering ID in your code. Nonetheless, you can still get an offering by ID (see below).
Qonversion.Product contains the following data:
PropertyDescription
qonversionIDQonversion product ID. For example, main
storeIDApp Stores Product ID
basePlanIDAndroid only. Identifier of the base plan for subscription product.
typeProduct type. Values: trial – subscription with a trial period; intro – subscription with an intro period; directSubscription/subscription – auto-renewable or prepaid (Android) subscription without a trial or intro; oneTime/inapp – non-recurring product.
duration (deprecated)iOS only. Duration of a product. Values: unknown – non-renewable purchases; weekly; monthly; 3Months; 6Months; annual. Note: there is no 2-month duration option since Google Play does not have it. Deprecated: use subscriptionPeriod instead.
subscriptionPeriodSubscription period for the product. Nil if the product is not a subscription. SubscriptionPeriod object contains two fields: SubscriptionPeriodUnitthat may be day/week/month/yearand IntegerunitCount. For example, SubscriptionPeriodUnit = .month and unitCount = 3 indicate that the subscription duration is 3 months. On Android and Cross-platform SDKs, there is also an iso field representing duration in ISO 8601 format, e.g. “P3M” for the above example.
trialDuration (deprecated)iOS only. Duration of an introductory offer. Values: notAvailable – trial not available; unknown – no trial info; threeDays; week; twoWeeks; month; twoMonths; threeMonths; sixMonths; year; other – duration not in enum range, check skuDetails or skProduct directly. Deprecated: use trialPeriod instead.
trialPeriodTrial period for the product. Nil if the product is not a subscription or trial not available. SubscriptionPeriod object contains two fields: SubscriptionPeriodUnitthat may be day/week/month/yearand IntegerunitCount. For example, SubscriptionPeriodUnit = .day and unitCount = 7 indicate that the trial duration is 7 days. On Android and Cross-platform SDKs, there is also an iso field representing duration in ISO 8601 format, e.g. “P3M” for the above example.
skProductiOS only. Contains SKProduct object received from StoreKit.
skuDetailAndroid only. Contains skuDetails object received from Google Billing Client. Deprecated: use storeDetails instead.
storeDetailsAndroid only. Describes the store details of the product, containing all the information from Google Play including the offers for purchasing the base plan of this product (specified by basePlanID) in case of a subscription. The complete description can be found on this page.
prettyPriceA localized product price with currency symbol provided by Apple or Google. It can be displayed to a user. For example, $99.99

Get Offering by ID

You can request the specific offering using its ID:
Qonversion.shared().offerings { (offerings, error) in
  if let offering = offerings?.offering(forIdentifier: "discount") {
    // offering is available
  }
}

Get The List of Available Products

Use the products method to get the list of the products available:
Qonversion.shared().products { productsList, error in
    let product = productsList["main"]
    if product?.type == .trial {

    }
}
The method returns the following two vars:
  • productsList – dictionary with available products
  • error - error
Qonversion Product IDs are the keys to the products’ dictionary objects. The values are the objects of the Qonversion.Product class.

Trial and introductory offer eligibility

You can check if a user is eligible for an introductory offer, including a free trial. It is calculated differently for iOS and Android users. On iOS, users who have not previously used an introductory offer for any products in the same subscription group are eligible for an introductory offer. On Android, eligibility is computed based on the store details. If Google Play Billing Library returned any of the trial or intro offers as a possible purchase option for a specific product, then it means that the user is eligible for it. You can show only a regular price for users not eligible for an introductory offer. Use the following function to determine eligibility:
Qonversion.shared().checkTrialIntroEligibility(["main", "secondary"]) { (result, error) in
  if let mainProductIntroEligibility = result["main"],
     mainProductIntroEligibility.status == .eligible {
     // handle available trial
  }
}

Create Products Making Purchases