getPromotionalOffer static method

Future<PromotionalOffer> getPromotionalOffer(
  1. StoreProduct product,
  2. StoreProductDiscount discount
)

iOS only.

Use this function to retrieve the PromotionalOffer to apply to a product. Returns a PromotionalOffer object which should be passed to purchaseDiscountedProduct or purchaseDiscountedPackage to complete the discounted purchase. A null PromotionalOffer means the user is not entitled to the discount.

product The StoreProduct the user intends to purchase.

discount The StoreProductDiscount to apply to the product.

Implementation

static Future<PromotionalOffer> getPromotionalOffer(
  StoreProduct product,
  StoreProductDiscount discount,
) async {
  final result = await _channel.invokeMethod('getPromotionalOffer', {
    'productIdentifier': product.identifier,
    'discountIdentifier': discount.identifier,
  });
  return PromotionalOffer.fromJson(Map<String, dynamic>.from(result));
}