@capgo/native-purchases 0.0.41 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -376,23 +376,14 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
376
376
|
) {
|
|
377
377
|
for (Purchase purchase : purchases) {
|
|
378
378
|
if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) {
|
|
379
|
-
if (
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
ConsumeParams consumeParams = ConsumeParams
|
|
388
|
-
.newBuilder()
|
|
389
|
-
.setPurchaseToken(purchase.getPurchaseToken())
|
|
390
|
-
.build();
|
|
391
|
-
billingClient.consumeAsync(
|
|
392
|
-
consumeParams,
|
|
393
|
-
this::onConsumeResponse
|
|
394
|
-
);
|
|
395
|
-
}
|
|
379
|
+
if (purchase.isAcknowledged()) {
|
|
380
|
+
ConsumeParams consumeParams = ConsumeParams
|
|
381
|
+
.newBuilder()
|
|
382
|
+
.setPurchaseToken(purchase.getPurchaseToken())
|
|
383
|
+
.build();
|
|
384
|
+
billingClient.consumeAsync(consumeParams, this::onConsumeResponse);
|
|
385
|
+
} else {
|
|
386
|
+
acknowledgePurchase(purchase.getPurchaseToken());
|
|
396
387
|
}
|
|
397
388
|
}
|
|
398
389
|
}
|
|
@@ -82,10 +82,10 @@ public class NativePurchasesPlugin: CAPPlugin {
|
|
|
82
82
|
Task {
|
|
83
83
|
do {
|
|
84
84
|
try await AppStore.sync()
|
|
85
|
-
// make finish() calls for all transactions
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
// make finish() calls for all transactions and consume all consumables
|
|
86
|
+
for transaction in SKPaymentQueue.default().transactions {
|
|
87
|
+
SKPaymentQueue.default().finishTransaction(transaction)
|
|
88
|
+
}
|
|
89
89
|
call.resolve()
|
|
90
90
|
} catch {
|
|
91
91
|
call.reject(error.localizedDescription)
|