@capgo/native-purchases 8.8.2 → 8.9.0

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.
@@ -20,8 +20,12 @@ final class ProductPayloadMapper {
20
20
 
21
21
  private ProductPayloadMapper() {}
22
22
 
23
+ /** Matches {@code INTRO_ELIGIBILITY_STATUS_UNKNOWN} in the TypeScript API. */
24
+ static final int INTRO_ELIGIBILITY_UNKNOWN = 0;
25
+
23
26
  static void applyInAppDefaults(JSObject product) {
24
27
  product.put("introductoryPrice", JSONObject.NULL);
28
+ product.put("introEligibility", INTRO_ELIGIBILITY_UNKNOWN);
25
29
  product.put("discounts", new JSONArray());
26
30
  }
27
31
 
@@ -95,6 +99,8 @@ final class ProductPayloadMapper {
95
99
  String currencyCode = standardPhase != null ? standardPhase.getPriceCurrencyCode() : product.getString("currencyCode", "");
96
100
  String currencySymbol = currencySymbol(currencyCode);
97
101
 
102
+ product.put("introEligibility", INTRO_ELIGIBILITY_UNKNOWN);
103
+
98
104
  if (offerDetails.getOfferId() == null) {
99
105
  ProductDetails.PricingPhase introPhase = findIntroductoryPricingPhase(phases);
100
106
  if (introPhase != null) {
package/dist/docs.json CHANGED
@@ -5,6 +5,35 @@
5
5
  "docs": "",
6
6
  "tags": [],
7
7
  "methods": [
8
+ {
9
+ "name": "configure",
10
+ "signature": "(options?: { autoFinishTransactions?: boolean | undefined; } | undefined) => Promise<void>",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "{ autoFinishTransactions?: boolean | undefined; } | undefined"
16
+ }
17
+ ],
18
+ "returns": "Promise<void>",
19
+ "tags": [
20
+ {
21
+ "name": "param",
22
+ "text": "options.autoFinishTransactions When false, manual finishing/acknowledgment is required for the flows above."
23
+ },
24
+ {
25
+ "name": "since",
26
+ "text": "8.9.0"
27
+ },
28
+ {
29
+ "name": "example",
30
+ "text": "```typescript\n// capacitor.config.ts\nexport default {\n plugins: {\n NativePurchases: {\n autoFinishTransactions: false,\n },\n },\n};\n\n// Optional runtime override (affects subsequent native operations)\nawait NativePurchases.configure({ autoFinishTransactions: false });\n```"
31
+ }
32
+ ],
33
+ "docs": "Configure plugin-wide purchase finishing behavior.\n\nCall this as early as possible (ideally before other NativePurchases APIs). You can also set\n`autoFinishTransactions` in `capacitor.config` under `plugins.NativePurchases` so iOS applies\nthe value before the native `transactionUpdated` listener starts.\n\n**`autoFinishTransactions` (default `true`)**\n\n- **iOS (StoreKit 2)**: When `true`, the plugin finishes transactions automatically for\n `transactionUpdated`, `restorePurchases`, and `purchaseProduct` (when\n `autoAcknowledgePurchases` is also true). When `false`, transactions stay unfinished until you call\n `finishTransaction()` (or `acknowledgePurchase()` with the transaction ID).\n- **Android**: When `true`, `restorePurchases()` may auto-acknowledge unacknowledged purchases\n (recovery flow). When `false`, recovery does not acknowledge; use `acknowledgePurchase()`.\n `purchaseProduct()` auto-acknowledges only when both `autoFinishTransactions` and\n `autoAcknowledgePurchases` are true.\n\n**`autoAcknowledgePurchases`** applies only to the `purchaseProduct()` call and does not change\nhow the iOS `transactionUpdated` listener finishes transactions. Use this method (or config) for that.",
34
+ "complexTypes": [],
35
+ "slug": "configure"
36
+ },
8
37
  {
9
38
  "name": "restorePurchases",
10
39
  "signature": "() => Promise<void>",
@@ -143,7 +172,7 @@
143
172
  },
144
173
  {
145
174
  "name": "param",
146
- "text": "options.autoAcknowledgePurchases - When false, the purchase/transaction will NOT be automatically acknowledged/finished. You must manually call acknowledgePurchase() or the purchase may be refunded. Defaults to true.\n - **Android**: Must acknowledge within 3 days or Google Play will refund\n - **iOS**: Unfinished transactions remain in the queue and may block future purchases"
175
+ "text": "options.autoAcknowledgePurchases - When false, this purchase is not auto-finished/acknowledged when\n `autoFinishTransactions` is also true. Does not disable auto-finishing on\n the iOS `transactionUpdated` listener; use `configure({ autoFinishTransactions: false })`\n for manual finishing across purchase and recovery flows. Defaults to true.\n - **Android**: Must acknowledge within 3 days or Google Play will refund\n - **iOS**: Unfinished transactions remain in the queue and may block future purchases"
147
176
  }
148
177
  ],
149
178
  "docs": "Started purchase process for the given product.",
@@ -405,10 +434,60 @@
405
434
  "text": "```typescript\n// Client-side acknowledgment\nconst transaction = await NativePurchases.purchaseProduct({\n productIdentifier: 'premium_feature',\n autoAcknowledgePurchases: false\n});\n\n// Validate with your backend\nconst isValid = await fetch('/api/validate-purchase', {\n method: 'POST',\n body: JSON.stringify({ purchaseToken: transaction.purchaseToken })\n});\n\nif (isValid) {\n // Option 1: Acknowledge from client\n await NativePurchases.acknowledgePurchase({\n purchaseToken: transaction.purchaseToken\n });\n\n // Option 2: Or let your backend acknowledge via Google Play API\n // Your backend calls Google Play Developer API\n}\n```"
406
435
  }
407
436
  ],
408
- "docs": "Manually acknowledge/finish a purchase transaction.\n\nThis method is only needed when you set `autoAcknowledgePurchases: false` in purchaseProduct().\n\n**Platform Behavior:**\n- **Android**: Acknowledges the purchase with Google Play. Must be called within 3 days or the purchase will be refunded.\n- **iOS**: Finishes the transaction with StoreKit 2. Unfinished transactions remain in the queue and may block future purchases.\n\n**Acknowledgment Options:**\n\n**1. Client-side (this method)**: Call from your app after validation\n```typescript\nawait NativePurchases.acknowledgePurchase({\n purchaseToken: transaction.purchaseToken // Android: purchaseToken, iOS: transactionId\n});\n```\n\n**2. Server-side (Android only, recommended for security)**: Use Google Play Developer API v3\n- Endpoint: `POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge`\n- Requires OAuth 2.0 authentication with appropriate scopes\n- See: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/acknowledge\n- For subscriptions: Use `/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge` instead\n- Note: iOS has no server-side finish API\n\n**When to use manual acknowledgment:**\n- Server-side validation: Verify the purchase with your backend before acknowledging\n- Entitlement delivery: Ensure user receives content/features before acknowledging\n- Multi-step workflows: Complete all steps before final acknowledgment\n- Security: Prevent client-side manipulation by handling acknowledgment server-side (Android only)",
437
+ "docs": "Manually acknowledge/finish a purchase transaction.\n\nCall this when automatic finishing or acknowledgment is disabled, for example\n`purchaseProduct({ autoAcknowledgePurchases: false })`, `configure({ autoFinishTransactions: false })`\n(Android recovery or iOS updates), or when a returned transaction has `needsFinish: true`.\n\n**Platform Behavior:**\n- **Android**: Acknowledges the purchase with Google Play. Must be called within 3 days or the purchase will be refunded.\n- **iOS**: Finishes the transaction with StoreKit 2. Unfinished transactions remain in the queue and may block future purchases.\n\n**Acknowledgment Options:**\n\n**1. Client-side (this method)**: Call from your app after validation\n```typescript\nawait NativePurchases.acknowledgePurchase({\n purchaseToken: transaction.purchaseToken // Android: purchaseToken, iOS: transactionId\n});\n```\n\n**2. Server-side (Android only, recommended for security)**: Use Google Play Developer API v3\n- Endpoint: `POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge`\n- Requires OAuth 2.0 authentication with appropriate scopes\n- See: https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/acknowledge\n- For subscriptions: Use `/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge` instead\n- Note: iOS has no server-side finish API\n\n**When to use manual acknowledgment:**\n- Server-side validation: Verify the purchase with your backend before acknowledging\n- Entitlement delivery: Ensure user receives content/features before acknowledging\n- Multi-step workflows: Complete all steps before final acknowledgment\n- Security: Prevent client-side manipulation by handling acknowledgment server-side (Android only)",
409
438
  "complexTypes": [],
410
439
  "slug": "acknowledgepurchase"
411
440
  },
441
+ {
442
+ "name": "finishTransaction",
443
+ "signature": "(options: { transactionId: string; }) => Promise<void>",
444
+ "parameters": [
445
+ {
446
+ "name": "options",
447
+ "docs": "",
448
+ "type": "{ transactionId: string; }"
449
+ }
450
+ ],
451
+ "returns": "Promise<void>",
452
+ "tags": [
453
+ {
454
+ "name": "param",
455
+ "text": "options.transactionId StoreKit transaction ID from the `Transaction` object (numeric string)."
456
+ },
457
+ {
458
+ "name": "since",
459
+ "text": "8.9.0"
460
+ },
461
+ {
462
+ "name": "platform",
463
+ "text": "ios Finishes the transaction with StoreKit 2"
464
+ },
465
+ {
466
+ "name": "platform",
467
+ "text": "android Rejects; use `acknowledgePurchase()`"
468
+ }
469
+ ],
470
+ "docs": "Finish a StoreKit 2 transaction on iOS after you validate delivery on your backend.\n\nEquivalent to `acknowledgePurchase({ purchaseToken: transactionId })` on iOS. Safe to call more\nthan once; finishing an already finished transaction resolves successfully.\n\n**Android**: Google Play uses purchase acknowledgment, not StoreKit finishing. Call\n`acknowledgePurchase({ purchaseToken })` instead. This method rejects on Android.",
471
+ "complexTypes": [],
472
+ "slug": "finishtransaction"
473
+ },
474
+ {
475
+ "name": "getUnfinishedTransactions",
476
+ "signature": "() => Promise<{ transactions: Transaction[]; }>",
477
+ "parameters": [],
478
+ "returns": "Promise<{ transactions: Transaction[]; }>",
479
+ "tags": [
480
+ {
481
+ "name": "since",
482
+ "text": "8.9.0"
483
+ }
484
+ ],
485
+ "docs": "Returns transactions that still need finishing on iOS, or unacknowledged purchases on Android.\n\nUse on app launch when `autoFinishTransactions` is `false` to recover work after a restart.\n\n**Android recovery:** After validation, call `consumePurchase({ purchaseToken })` for consumable\nin-app products (acknowledges and consumes). Call `acknowledgePurchase({ purchaseToken })` for\nnon-consumables and subscriptions. Includes only purchases in the `PURCHASED` state that are not\nyet acknowledged. Pending purchases are excluded until Google Play marks them purchased.",
486
+ "complexTypes": [
487
+ "Transaction"
488
+ ],
489
+ "slug": "getunfinishedtransactions"
490
+ },
412
491
  {
413
492
  "name": "consumePurchase",
414
493
  "signature": "(options: { purchaseToken: string; }) => Promise<void>",
@@ -494,7 +573,7 @@
494
573
  ],
495
574
  "returns": "Promise<PluginListenerHandle>",
496
575
  "tags": [],
497
- "docs": "Listen for StoreKit transaction updates delivered by Apple's Transaction.updates.\nFires on app launch if there are unfinished transactions, and for any updates afterward.\niOS only.",
576
+ "docs": "Listen for StoreKit transaction updates delivered by Apple's Transaction.updates.\nFires on app launch if there are unfinished transactions, and for any updates afterward.\n\nWhen `autoFinishTransactions` is `true` (default), the plugin finishes each verified transaction\nbefore emitting the event. When `false`, the event includes `needsFinish: true` and you must call\n`finishTransaction()` after backend validation.\n\niOS only.",
498
577
  "complexTypes": [
499
578
  "PluginListenerHandle",
500
579
  "Transaction"
@@ -1320,6 +1399,26 @@
1320
1399
  "docs": "Whether the transaction is in a grace period.\n\nGrace period allows users to fix payment issues while maintaining access.\nYou typically want to continue providing access during this time.\n\n- `true`: Subscription payment failed but user still has access\n- `false`: Not in grace period",
1321
1400
  "complexTypes": [],
1322
1401
  "type": "boolean | undefined"
1402
+ },
1403
+ {
1404
+ "name": "needsFinish",
1405
+ "tags": [
1406
+ {
1407
+ "text": "8.9.0",
1408
+ "name": "since"
1409
+ },
1410
+ {
1411
+ "text": "ios Present when the transaction is unfinished in StoreKit 2",
1412
+ "name": "platform"
1413
+ },
1414
+ {
1415
+ "text": "android Not available (use `isAcknowledged === false` instead)",
1416
+ "name": "platform"
1417
+ }
1418
+ ],
1419
+ "docs": "Whether the StoreKit transaction still needs to be finished with `finishTransaction()`.\n\nPresent when the transaction is returned from `getUnfinishedTransactions()` or from\n`transactionUpdated` while `autoFinishTransactions` is `false`.",
1420
+ "complexTypes": [],
1421
+ "type": "boolean | undefined"
1323
1422
  }
1324
1423
  ]
1325
1424
  },
@@ -1658,6 +1757,28 @@
1658
1757
  ],
1659
1758
  "type": "SKProductDiscount | null"
1660
1759
  },
1760
+ {
1761
+ "name": "introEligibility",
1762
+ "tags": [
1763
+ {
1764
+ "text": "ios Set from StoreKit `isEligibleForIntroOffer` when the product has an introductory offer.",
1765
+ "name": "platform"
1766
+ },
1767
+ {
1768
+ "text": "android Always `INTRO_ELIGIBILITY_STATUS_UNKNOWN` (Google Play filters ineligible offers in billing).",
1769
+ "name": "platform"
1770
+ },
1771
+ {
1772
+ "text": "8.8.3",
1773
+ "name": "since"
1774
+ }
1775
+ ],
1776
+ "docs": "Whether the current store account is eligible for an introductory offer on this subscription.",
1777
+ "complexTypes": [
1778
+ "INTRO_ELIGIBILITY_STATUS"
1779
+ ],
1780
+ "type": "INTRO_ELIGIBILITY_STATUS"
1781
+ },
1661
1782
  {
1662
1783
  "name": "discounts",
1663
1784
  "tags": [
@@ -2054,6 +2175,30 @@
2054
2175
  "docs": "A type of SKU for subscriptions."
2055
2176
  }
2056
2177
  ]
2178
+ },
2179
+ {
2180
+ "name": "INTRO_ELIGIBILITY_STATUS",
2181
+ "slug": "intro_eligibility_status",
2182
+ "members": [
2183
+ {
2184
+ "name": "INTRO_ELIGIBILITY_STATUS_UNKNOWN",
2185
+ "value": "0",
2186
+ "tags": [],
2187
+ "docs": "doesn't have enough information to determine eligibility."
2188
+ },
2189
+ {
2190
+ "name": "INTRO_ELIGIBILITY_STATUS_INELIGIBLE",
2191
+ "value": "1",
2192
+ "tags": [],
2193
+ "docs": "The user is not eligible for a free trial or intro pricing for this product."
2194
+ },
2195
+ {
2196
+ "name": "INTRO_ELIGIBILITY_STATUS_ELIGIBLE",
2197
+ "value": "2",
2198
+ "tags": [],
2199
+ "docs": "The user is eligible for a free trial or intro pricing for this product."
2200
+ }
2201
+ ]
2057
2202
  }
2058
2203
  ],
2059
2204
  "typeAliases": [
@@ -551,6 +551,17 @@ export interface Transaction {
551
551
  * @platform android Present for subscriptions in grace period
552
552
  */
553
553
  readonly isInGracePeriod?: boolean;
554
+ /**
555
+ * Whether the StoreKit transaction still needs to be finished with `finishTransaction()`.
556
+ *
557
+ * Present when the transaction is returned from `getUnfinishedTransactions()` or from
558
+ * `transactionUpdated` while `autoFinishTransactions` is `false`.
559
+ *
560
+ * @since 8.9.0
561
+ * @platform ios Present when the transaction is unfinished in StoreKit 2
562
+ * @platform android Not available (use `isAcknowledged === false` instead)
563
+ */
564
+ readonly needsFinish?: boolean;
554
565
  }
555
566
  export interface TransactionVerificationFailedEvent {
556
567
  /**
@@ -957,6 +968,14 @@ export interface Product {
957
968
  * @platform android Populated from the first pricing phase on base subscription offers when multiple phases are present.
958
969
  */
959
970
  readonly introductoryPrice: SKProductDiscount | null;
971
+ /**
972
+ * Whether the current store account is eligible for an introductory offer on this subscription.
973
+ *
974
+ * @platform ios Set from StoreKit `isEligibleForIntroOffer` when the product has an introductory offer.
975
+ * @platform android Always `INTRO_ELIGIBILITY_STATUS_UNKNOWN` (Google Play filters ineligible offers in billing).
976
+ * @since 8.8.3
977
+ */
978
+ readonly introEligibility?: INTRO_ELIGIBILITY_STATUS;
960
979
  /**
961
980
  * The Product discounts list.
962
981
  *
@@ -966,6 +985,48 @@ export interface Product {
966
985
  readonly discounts: SKProductDiscount[];
967
986
  }
968
987
  export interface NativePurchasesPlugin {
988
+ /**
989
+ * Configure plugin-wide purchase finishing behavior.
990
+ *
991
+ * Call this as early as possible (ideally before other NativePurchases APIs). You can also set
992
+ * `autoFinishTransactions` in `capacitor.config` under `plugins.NativePurchases` so iOS applies
993
+ * the value before the native `transactionUpdated` listener starts.
994
+ *
995
+ * **`autoFinishTransactions` (default `true`)**
996
+ *
997
+ * - **iOS (StoreKit 2)**: When `true`, the plugin finishes transactions automatically for
998
+ * `transactionUpdated`, `restorePurchases`, and `purchaseProduct` (when
999
+ * `autoAcknowledgePurchases` is also true). When `false`, transactions stay unfinished until you call
1000
+ * `finishTransaction()` (or `acknowledgePurchase()` with the transaction ID).
1001
+ * - **Android**: When `true`, `restorePurchases()` may auto-acknowledge unacknowledged purchases
1002
+ * (recovery flow). When `false`, recovery does not acknowledge; use `acknowledgePurchase()`.
1003
+ * `purchaseProduct()` auto-acknowledges only when both `autoFinishTransactions` and
1004
+ * `autoAcknowledgePurchases` are true.
1005
+ *
1006
+ * **`autoAcknowledgePurchases`** applies only to the `purchaseProduct()` call and does not change
1007
+ * how the iOS `transactionUpdated` listener finishes transactions. Use this method (or config) for that.
1008
+ *
1009
+ * @param options.autoFinishTransactions When false, manual finishing/acknowledgment is required for the flows above.
1010
+ * @since 8.9.0
1011
+ *
1012
+ * @example
1013
+ * ```typescript
1014
+ * // capacitor.config.ts
1015
+ * export default {
1016
+ * plugins: {
1017
+ * NativePurchases: {
1018
+ * autoFinishTransactions: false,
1019
+ * },
1020
+ * },
1021
+ * };
1022
+ *
1023
+ * // Optional runtime override (affects subsequent native operations)
1024
+ * await NativePurchases.configure({ autoFinishTransactions: false });
1025
+ * ```
1026
+ */
1027
+ configure(options?: {
1028
+ autoFinishTransactions?: boolean;
1029
+ }): Promise<void>;
969
1030
  /**
970
1031
  * Restores a user's previous and links their appUserIDs to any user's also using those .
971
1032
  */
@@ -1068,7 +1129,10 @@ export interface NativePurchasesPlugin {
1068
1129
  * SECURITY: DO NOT use PII like emails in cleartext - use UUID or hashed value.
1069
1130
  * RECOMMENDED: Use UUID v5 with deterministic generation for cross-platform compatibility.
1070
1131
  * @param options.isConsumable - Only Android, when true the purchase token is consumed after granting entitlement (for consumable in-app items). Defaults to false.
1071
- * @param options.autoAcknowledgePurchases - When false, the purchase/transaction will NOT be automatically acknowledged/finished. You must manually call acknowledgePurchase() or the purchase may be refunded. Defaults to true.
1132
+ * @param options.autoAcknowledgePurchases - When false, this purchase is not auto-finished/acknowledged when
1133
+ * `autoFinishTransactions` is also true. Does not disable auto-finishing on
1134
+ * the iOS `transactionUpdated` listener; use `configure({ autoFinishTransactions: false })`
1135
+ * for manual finishing across purchase and recovery flows. Defaults to true.
1072
1136
  * - **Android**: Must acknowledge within 3 days or Google Play will refund
1073
1137
  * - **iOS**: Unfinished transactions remain in the queue and may block future purchases
1074
1138
  */
@@ -1197,7 +1261,9 @@ export interface NativePurchasesPlugin {
1197
1261
  /**
1198
1262
  * Manually acknowledge/finish a purchase transaction.
1199
1263
  *
1200
- * This method is only needed when you set `autoAcknowledgePurchases: false` in purchaseProduct().
1264
+ * Call this when automatic finishing or acknowledgment is disabled, for example
1265
+ * `purchaseProduct({ autoAcknowledgePurchases: false })`, `configure({ autoFinishTransactions: false })`
1266
+ * (Android recovery or iOS updates), or when a returned transaction has `needsFinish: true`.
1201
1267
  *
1202
1268
  * **Platform Behavior:**
1203
1269
  * - **Android**: Acknowledges the purchase with Google Play. Must be called within 3 days or the purchase will be refunded.
@@ -1261,6 +1327,38 @@ export interface NativePurchasesPlugin {
1261
1327
  acknowledgePurchase(options: {
1262
1328
  purchaseToken: string;
1263
1329
  }): Promise<void>;
1330
+ /**
1331
+ * Finish a StoreKit 2 transaction on iOS after you validate delivery on your backend.
1332
+ *
1333
+ * Equivalent to `acknowledgePurchase({ purchaseToken: transactionId })` on iOS. Safe to call more
1334
+ * than once; finishing an already finished transaction resolves successfully.
1335
+ *
1336
+ * **Android**: Google Play uses purchase acknowledgment, not StoreKit finishing. Call
1337
+ * `acknowledgePurchase({ purchaseToken })` instead. This method rejects on Android.
1338
+ *
1339
+ * @param options.transactionId StoreKit transaction ID from the `Transaction` object (numeric string).
1340
+ * @since 8.9.0
1341
+ * @platform ios Finishes the transaction with StoreKit 2
1342
+ * @platform android Rejects; use `acknowledgePurchase()`
1343
+ */
1344
+ finishTransaction(options: {
1345
+ transactionId: string;
1346
+ }): Promise<void>;
1347
+ /**
1348
+ * Returns transactions that still need finishing on iOS, or unacknowledged purchases on Android.
1349
+ *
1350
+ * Use on app launch when `autoFinishTransactions` is `false` to recover work after a restart.
1351
+ *
1352
+ * **Android recovery:** After validation, call `consumePurchase({ purchaseToken })` for consumable
1353
+ * in-app products (acknowledges and consumes). Call `acknowledgePurchase({ purchaseToken })` for
1354
+ * non-consumables and subscriptions. Includes only purchases in the `PURCHASED` state that are not
1355
+ * yet acknowledged. Pending purchases are excluded until Google Play marks them purchased.
1356
+ *
1357
+ * @since 8.9.0
1358
+ */
1359
+ getUnfinishedTransactions(): Promise<{
1360
+ transactions: Transaction[];
1361
+ }>;
1264
1362
  /**
1265
1363
  * Consume an in-app purchase on Android.
1266
1364
  *
@@ -1350,6 +1448,11 @@ export interface NativePurchasesPlugin {
1350
1448
  /**
1351
1449
  * Listen for StoreKit transaction updates delivered by Apple's Transaction.updates.
1352
1450
  * Fires on app launch if there are unfinished transactions, and for any updates afterward.
1451
+ *
1452
+ * When `autoFinishTransactions` is `true` (default), the plugin finishes each verified transaction
1453
+ * before emitting the event. When `false`, the event includes `needsFinish: true` and you must call
1454
+ * `finishTransaction()` after backend validation.
1455
+ *
1353
1456
  * iOS only.
1354
1457
  */
1355
1458
  addListener(eventName: 'transactionUpdated', listenerFunc: (transaction: Transaction) => void): Promise<PluginListenerHandle>;