@capgo/native-purchases 8.9.12 → 8.9.13
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.
package/README.md
CHANGED
|
@@ -1834,6 +1834,12 @@ StoreKit re-delivers an unverified transaction on every launch until it is finis
|
|
|
1834
1834
|
|
|
1835
1835
|
After validation when automatic acknowledgment is off (for example `configure({ autoFinishTransactions: false })` or `purchaseProduct({ autoAcknowledgePurchases: false })`), call `consumePurchase({ purchaseToken })` for consumable in-app products (acknowledges and consumes), or `acknowledgePurchase({ purchaseToken })` for non-consumables and subscriptions. `finishTransaction({ transactionId })` also acknowledges on Android, where `transactionId` is the purchase token. With `autoFinishTransactions: false`, `restorePurchases()` does not auto-acknowledge; use `getUnfinishedTransactions()` to list unacknowledged purchases in the `PURCHASED` state (`isAcknowledged === false`).
|
|
1836
1836
|
|
|
1837
|
+
**Android: recovering an interrupted finish**
|
|
1838
|
+
|
|
1839
|
+
An acknowledge or consume can be lost before Google Play answers, for example when the app is killed mid-finish. Plugin teardown (when Capacitor destroys the plugin with its activity) also closes the current billing client even while a finish is still in flight, and Play drops any work that client had queued. The purchase then stays unacknowledged, and Google Play refunds purchases that are not acknowledged within three days.
|
|
1840
|
+
|
|
1841
|
+
With `autoFinishTransactions: true` (the default), call `restorePurchases()` at app launch. It acknowledges any `PURCHASED` purchase that is still unacknowledged, so a purchase interrupted by a lost finish is completed on the next start. With `autoFinishTransactions: false`, use `getUnfinishedTransactions()` at launch instead and finish each purchase after validation.
|
|
1842
|
+
|
|
1837
1843
|
## Breaking (TypeScript typings)
|
|
1838
1844
|
|
|
1839
1845
|
`Product.subscriptionPeriod` is now optional. Android omits it on prepaid (non-recurring) offers, which have price only. The period is present for infinite recurring phases, or for finite recurring phases on installment offers. Reading `product.subscriptionPeriod.unit` without a check is a TypeScript error. Use optional chaining, for example `product.subscriptionPeriod?.unit`. See [`Product`](#product).
|
|
@@ -103,7 +103,7 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
103
103
|
return SubscriptionOfferPurchaseResult.ok(selected.getOfferToken(), selected.getBasePlanId());
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
private final String pluginVersion = "8.9.
|
|
106
|
+
private final String pluginVersion = "8.9.13";
|
|
107
107
|
public static final String TAG = "NativePurchases";
|
|
108
108
|
private static final int BILLING_CONNECTION_MAX_ATTEMPTS = 2;
|
|
109
109
|
private static final long BILLING_SETUP_TIMEOUT_SECONDS = 5;
|
|
@@ -26,7 +26,7 @@ public class NativePurchasesPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
26
26
|
CAPPluginMethod(name: "finishTransaction", returnType: CAPPluginReturnPromise)
|
|
27
27
|
]
|
|
28
28
|
|
|
29
|
-
private let pluginVersion: String = "8.9.
|
|
29
|
+
private let pluginVersion: String = "8.9.13"
|
|
30
30
|
var autoFinishTransactions: Bool = true
|
|
31
31
|
private var transactionUpdatesTask: Task<Void, Never>?
|
|
32
32
|
|