What's new
- iOS promotional offers support
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.
const promo = subscriptionProduct.skProduct?.discounts.find(discount =>
discount.identifier === 'my_promo_offer_id'
);
const promoOffer = await Qonversion.getSharedInstance().getPromotionalOffer(subscriptionProduct, promo);
// handle promo offer here
} catch (e) {
// handle error here
}
Then make a purchase using this promo offer.
const purchaseOptions = new PurchaseOptionsBuilder()
.setPromotionalOffer(promoOffer))
.build();
const entitlements = await Qonversion.getSharedInstance().purchaseProduct(
subscriptionProduct,
purchaseOptions
);