makePromotedPurchase method
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:
product: an AdaptyPromotedProduct object received from didReceivePromotedPurchaseStream.
Returns:
- The AdaptyPurchaseResult object. This model contains info about the purchase result.
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,
},
);
}