purchaseDiscountedProduct static method

Future<PurchaserInfo> purchaseDiscountedProduct(
  1. Product product,
  2. PaymentDiscount discount
)

iOS only. Purchase a product applying a given discount.

Returns a PurchaserInfo object. Throws a PlatformException if the purchase is unsuccessful. Check if PurchasesErrorHelper.getErrorCode(e) is PurchasesErrorCode.purchaseCancelledError to check if the user cancelled the purchase.

product The product to purchase.

paymentDiscount Discount to apply to the product. Retrieve this discount using getPaymentDiscount.

Implementation

static Future<rc.PurchaserInfo> purchaseDiscountedProduct(
    rc.Product product, rc.PaymentDiscount discount) async {
  return rc.Purchases.purchaseDiscountedProduct(product, discount);
}