purchaseProductWithWinBackOffer static method
- @Deprecated('Use purchase(PurchaseParams)')
- StoreProduct product,
- WinBackOffer winBackOffer
iOS only, requires iOS 18.0 or greater with StoreKit 2. Purchase a product applying a given win-back offer.
Returns a PurchaseResult object. Throws a PlatformException if the purchase is unsuccessful. Check if PurchasesErrorHelper.getErrorCode is PurchasesErrorCode.purchaseCancelledError to check if the user cancelled the purchase.
storeProduct The product to purchase.
winBackOffer Win-back offer that will be applied to the product.
Retrieve this offer using getEligibleWinBackOffersForProduct
or getEligibleWinBackOffersForPackage.
Implementation
@Deprecated('Use purchase(PurchaseParams)')
static Future<PurchaseResult> purchaseProductWithWinBackOffer(
StoreProduct product,
WinBackOffer winBackOffer,
) async {
final purchaseResult =
await _invokeReturningPurchaseResult('purchaseProductWithWinBackOffer', {
'productIdentifier': product.identifier,
'winBackOfferIdentifier': winBackOffer.identifier,
});
return purchaseResult;
}