Skip to content

9.2.0

Compare
Choose a tag to compare
@github-actions github-actions released this 25 Nov 11:13
· 7 commits to main since this release
69156b4

What's new

  • Minimal supported Dart SDK version is bumped to 2.14.0.
  • iOS promotional offers supported.

To load the promo offer data, call the following function.

try {
  // You can obtain the product and discount in any other way. This approach is used here as an example.
  var promo = subscriptionProduct.skProduct?.discounts?.firstWhereOrNull(
    (discount) => discount.identifier == 'my_promo_offer_id'
  );

  if (promo != null) {
    var promoOffer = await Qonversion.getSharedInstance().getPromotionalOffer(subscriptionProduct, promo);
    // handle promo offer here
  }
} on Exception catch (e) {
  // handle error here
}

Then make a purchase using this promo offer.

var purchaseOptions = QPurchaseOptionsBuilder()
        .setPromotionalOffer(promoOffer)
        .build();

var entitlements = await Qonversion.getSharedInstance().purchaseProduct(
    subscriptionProduct,
    purchaseOptions: purchaseOptions
);