From 7d1ee0bcaf35c702cbf1589ceb11e2308a984084 Mon Sep 17 00:00:00 2001 From: Kamo Spertsyan Date: Tue, 24 Dec 2024 16:23:41 +0300 Subject: [PATCH] Fixed update policy for purchase with options. --- lib/src/internal/qonversion_internal.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/internal/qonversion_internal.dart b/lib/src/internal/qonversion_internal.dart index 3c8e75a..d213ff9 100644 --- a/lib/src/internal/qonversion_internal.dart +++ b/lib/src/internal/qonversion_internal.dart @@ -112,13 +112,16 @@ class QonversionInternal implements Qonversion { promoOfferData['timestamp'] = purchaseOptions.promotionalOffer?.paymentDiscount.timestamp; } + final updatePolicy = purchaseOptions.updatePolicy; final rawResult = await _channel .invokeMethod(Constants.mPurchase, { Constants.kProductId: product.qonversionId, Constants.kOldProductId: purchaseOptions.oldProduct?.qonversionId, Constants.kOfferId: purchaseOptions.offerId, Constants.kApplyOffer: purchaseOptions.applyOffer, - Constants.kUpdatePolicyKey: purchaseOptions.updatePolicy, + Constants.kUpdatePolicyKey: updatePolicy != null + ? StringUtils.capitalize(describeEnum(updatePolicy)) + : null, Constants.kPurchaseContextKeys: purchaseOptions.contextKeys, Constants.kPurchaseQuantity: purchaseOptions.quantity, Constants.kPromoOffer: promoOfferData,