makePromotedPurchase method

Future<AdaptyPurchaseResult> makePromotedPurchase({
  1. required AdaptyPromotedProduct product,
})

Continue a promoted purchase received from the App Store. iOS only.

Call this with a product from didReceivePromotedPurchaseStream. You need it only while you have a subscription to that stream: with no subscriber the SDK calls it itself. A promoted product carries no paywall context, so no purchase parameters are accepted.

Promoted in-app purchases are an App Store feature; on other platforms the returned future completes with an error.

Parameters:

Returns:

Implementation

Future<AdaptyPurchaseResult> makePromotedPurchase({
  required AdaptyPromotedProduct product,
}) {
  return _invokeMethod<AdaptyPurchaseResult>(
    Method.makePromotedPurchase,
    (data) {
      final purchaseResultMap = data as Map<String, dynamic>;
      return AdaptyPurchaseResultJSONBuilder.fromJsonValue(purchaseResultMap);
    },
    {
      Argument.product: product.jsonValue,
    },
  );
}