9.2.0
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
);