capacitor-plugin-cdv-purchase 13.15.2 → 13.15.3

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.
@@ -499,6 +499,7 @@ public class PurchasePlugin extends Plugin implements
499
499
  .enableOneTimeProducts()
500
500
  .enablePrepaidPlans()
501
501
  .build())
502
+ .enableAutoServiceReconnection()
502
503
  .setListener(this)
503
504
  .build();
504
505
 
@@ -795,8 +796,8 @@ public class PurchasePlugin extends Plugin implements
795
796
  mPendingBuyCall = null;
796
797
  }
797
798
  }
798
- } catch (JSONException e) {
799
- Log.w(TAG, "onPurchasesUpdated() -> JSONException "
799
+ } catch (Exception e) {
800
+ Log.w(TAG, "onPurchasesUpdated() -> Exception "
800
801
  + e.getMessage());
801
802
  }
802
803
  }
package/dist/index.js CHANGED
@@ -1645,7 +1645,7 @@ var CdvPurchase;
1645
1645
  /**
1646
1646
  * Current release number of the plugin.
1647
1647
  */
1648
- CdvPurchase.PLUGIN_VERSION = '13.15.2';
1648
+ CdvPurchase.PLUGIN_VERSION = '13.15.3';
1649
1649
  /**
1650
1650
  * Entry class of the plugin.
1651
1651
  */
@@ -3121,9 +3121,14 @@ var CdvPurchase;
3121
3121
  this.initializeAppReceipt(() => {
3122
3122
  var _a;
3123
3123
  if (!this._receipt) {
3124
- // this should not happen
3125
- this.log.warn('Failed to load the application receipt, cannot proceed with handling the purchase');
3126
- return;
3124
+ // Receipt failed to load — create a minimal receipt so the
3125
+ // transaction can still be tracked and finished. Without this
3126
+ // fallback the Promise would never resolve, leaving the native
3127
+ // transaction unfinished (causing the purchase dialog to loop on
3128
+ // iOS — see #1568).
3129
+ this.log.warn('Application receipt unavailable, creating a fallback receipt to avoid blocking transactions');
3130
+ this._receipt = new AppleAppStore.SKApplicationReceipt({ appStoreReceipt: '', bundleIdentifier: '',
3131
+ bundleShortVersion: '', bundleNumericVersion: 0, bundleSignature: '' }, this.needAppReceipt, this.context.apiDecorators);
3127
3132
  }
3128
3133
  const existing = (_a = this._receipt) === null || _a === void 0 ? void 0 : _a.transactions.find(t => t.transactionId === transactionId);
3129
3134
  if (existing) {
@@ -3285,8 +3290,22 @@ var CdvPurchase;
3285
3290
  });
3286
3291
  }
3287
3292
  loadReceipts() {
3288
- return new Promise((resolve) => {
3289
- setTimeout(() => {
3293
+ return __awaiter(this, void 0, void 0, function* () {
3294
+ // Wait for native pending transactions to be processed before
3295
+ // initializing the receipt. Previously used a fixed 300ms delay
3296
+ // which was unreliable and could miss transactions that arrived
3297
+ // from the native queue (see #1529).
3298
+ //
3299
+ // The pendingTransactionsReady Promise resolves when the native
3300
+ // `processPendingTransactions` call returns, but the per-transaction
3301
+ // callbacks it triggers via evalJs land asynchronously. Yield one
3302
+ // task so those purchased/restored callbacks (and their async
3303
+ // upsertTransaction chain) settle before we snapshot _receipt.
3304
+ if (this.bridge.pendingTransactionsReady) {
3305
+ yield this.bridge.pendingTransactionsReady;
3306
+ yield new Promise(r => setTimeout(r, 0));
3307
+ }
3308
+ return new Promise((resolve) => {
3290
3309
  this.initializeAppReceipt(() => {
3291
3310
  this.receiptsUpdated.call();
3292
3311
  if (this._receipt) {
@@ -3296,7 +3315,7 @@ var CdvPurchase;
3296
3315
  resolve([this.pseudoReceipt]);
3297
3316
  }
3298
3317
  });
3299
- }, 300);
3318
+ });
3300
3319
  });
3301
3320
  }
3302
3321
  canMakePayments() {
@@ -3352,6 +3371,7 @@ var CdvPurchase;
3352
3371
  return;
3353
3372
  }
3354
3373
  this._receipt = new AppleAppStore.SKApplicationReceipt(nativeData, this.needAppReceipt, this.context.apiDecorators);
3374
+ this._appStoreReceiptLoading = false;
3355
3375
  callCallbacks(undefined);
3356
3376
  });
3357
3377
  }
@@ -4140,6 +4160,9 @@ var CdvPurchase;
4140
4160
  protectCall(this.options.ready, 'options.ready');
4141
4161
  protectCall(success, 'init.success');
4142
4162
  this.initialized = true;
4163
+ this.pendingTransactionsReady = new Promise(resolve => {
4164
+ this._pendingTransactionsResolve = resolve;
4165
+ });
4143
4166
  setTimeout(() => this.processPendingTransactions(), 50);
4144
4167
  };
4145
4168
  const setupFailed = (err) => {
@@ -4152,6 +4175,10 @@ var CdvPurchase;
4152
4175
  log('processing pending transactions');
4153
4176
  exec('processPendingTransactions', [], () => {
4154
4177
  this.finalizeTransactionUpdates();
4178
+ if (this._pendingTransactionsResolve) {
4179
+ this._pendingTransactionsResolve();
4180
+ this._pendingTransactionsResolve = undefined;
4181
+ }
4155
4182
  }, undefined);
4156
4183
  }
4157
4184
  purchase(productId, quantity, applicationUsername, discount, success, error) {
@@ -4459,6 +4486,9 @@ var CdvPurchase;
4459
4486
  protectCall(this.options.ready, 'options.ready');
4460
4487
  protectCall(success, 'init.success');
4461
4488
  this.initialized = true;
4489
+ this.pendingTransactionsReady = new Promise(resolve => {
4490
+ this._pendingTransactionsResolve = resolve;
4491
+ });
4462
4492
  setTimeout(() => this.processPendingTransactions(), 50);
4463
4493
  };
4464
4494
  const setupFailed = (err) => {
@@ -4472,6 +4502,10 @@ var CdvPurchase;
4472
4502
  log('processing pending transactions');
4473
4503
  exec('processPendingTransactions', [], () => {
4474
4504
  this.finalizeTransactionUpdates();
4505
+ if (this._pendingTransactionsResolve) {
4506
+ this._pendingTransactionsResolve();
4507
+ this._pendingTransactionsResolve = undefined;
4508
+ }
4475
4509
  }, undefined);
4476
4510
  }
4477
4511
  /**
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["esm/index.js","../build/entry.mjs"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n// Set the marker so the shared store.js knows Capacitor native bridges are available\nif (typeof window !== 'undefined') {\n window.CdvPurchaseCapacitor = { installed: true };\n}\nconst PurchasePlugin = registerPlugin('PurchasePlugin');\nexport { PurchasePlugin };\n","// Capacitor bridge — sets CdvPurchaseCapacitor marker and registers native plugin\nexport { PurchasePlugin } from '../dist/esm/index.js';\n\n// Store runtime — executes the IIFE, creates window.CdvPurchase\nimport { CdvPurchase } from 'virtual:store-js';\n\n// Re-export the full namespace\nexport { CdvPurchase };\n\n// Convenience named exports\nexport const store = CdvPurchase.store;\nexport const Store = CdvPurchase.Store;\nexport const ProductType = CdvPurchase.ProductType;\nexport const Platform = CdvPurchase.Platform;\nexport const LogLevel = CdvPurchase.LogLevel;\nexport const ErrorCode = CdvPurchase.ErrorCode;\nexport const Logger = CdvPurchase.Logger;\nexport const Iaptic = CdvPurchase.Iaptic;\n"],"names":[],"mappings":";;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,IAAI,MAAM,CAAC,oBAAoB,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;AACrD;AACK,MAAC,cAAc,GAAG,cAAc,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AASA;AACY,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,WAAW,GAAG,WAAW,CAAC;AAC3B,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,SAAS,GAAG,WAAW,CAAC;AACzB,MAAC,MAAM,GAAG,WAAW,CAAC;AACtB,MAAC,MAAM,GAAG,WAAW,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["esm/index.js","../build/entry.mjs"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n// Set the marker so the shared store.js knows Capacitor native bridges are available\nif (typeof window !== 'undefined') {\n window.CdvPurchaseCapacitor = { installed: true };\n}\nconst PurchasePlugin = registerPlugin('PurchasePlugin');\nexport { PurchasePlugin };\n","// Capacitor bridge — sets CdvPurchaseCapacitor marker and registers native plugin\nexport { PurchasePlugin } from '../dist/esm/index.js';\n\n// Store runtime — executes the IIFE, creates window.CdvPurchase\nimport { CdvPurchase } from 'virtual:store-js';\n\n// Re-export the full namespace\nexport { CdvPurchase };\n\n// Convenience named exports\nexport const store = CdvPurchase.store;\nexport const Store = CdvPurchase.Store;\nexport const ProductType = CdvPurchase.ProductType;\nexport const Platform = CdvPurchase.Platform;\nexport const LogLevel = CdvPurchase.LogLevel;\nexport const ErrorCode = CdvPurchase.ErrorCode;\nexport const Logger = CdvPurchase.Logger;\nexport const Iaptic = CdvPurchase.Iaptic;\n"],"names":[],"mappings":";;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,IAAI,MAAM,CAAC,oBAAoB,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;AACrD;AACK,MAAC,cAAc,GAAG,cAAc,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLtD;;AASA;AACY,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,WAAW,GAAG,WAAW,CAAC;AAC3B,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,SAAS,GAAG,WAAW,CAAC;AACzB,MAAC,MAAM,GAAG,WAAW,CAAC;AACtB,MAAC,MAAM,GAAG,WAAW,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-plugin-cdv-purchase",
3
- "version": "13.15.2",
3
+ "version": "13.15.3",
4
4
  "description": "In-App Purchases for Capacitor — iOS (StoreKit 2) and Android (Google Play Billing)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/www/store.d.ts CHANGED
@@ -716,7 +716,9 @@ declare namespace CdvPurchase {
716
716
  /**
717
717
  * Name of the group your subscription product is a member of.
718
718
  *
719
- * If you don't set anything, all subscription will be members of the same group.
719
+ * When set, purchasing a subscription in a group will replace the currently
720
+ * owned one (on Google Play, this triggers the subscription replacement flow).
721
+ * When not set, subscriptions are independent — no automatic replacement.
720
722
  */
721
723
  group?: string;
722
724
  }
@@ -884,7 +886,7 @@ declare namespace CdvPurchase {
884
886
  /**
885
887
  * Current release number of the plugin.
886
888
  */
887
- const PLUGIN_VERSION = "13.15.2";
889
+ const PLUGIN_VERSION = "13.15.3";
888
890
  /**
889
891
  * Entry class of the plugin.
890
892
  */
@@ -2832,6 +2834,8 @@ declare namespace CdvPurchase {
2832
2834
  };
2833
2835
  /** Whether this bridge uses StoreKit 2 */
2834
2836
  readonly isSK2?: boolean;
2837
+ /** Resolves when pending transactions from the native queue have been processed */
2838
+ pendingTransactionsReady?: Promise<void>;
2835
2839
  init(options: Partial<BridgeOptions>, success: () => void, error: (code: ErrorCode, message: string) => void): void;
2836
2840
  load(productIds: string[], success: (validProducts: ValidProduct[], invalidProductIds: string[]) => void, error: (code: ErrorCode, message: string) => void): void;
2837
2841
  purchase(productId: string, quantity: number, applicationUsername: string | undefined, discount: PaymentDiscount | undefined, success: () => void, error: () => void): void;
@@ -2866,6 +2870,8 @@ declare namespace CdvPurchase {
2866
2870
  appStoreReceipt?: AppleAppStore.ApplicationReceipt | null;
2867
2871
  private registeredProducts;
2868
2872
  private needRestoreNotification;
2873
+ pendingTransactionsReady?: Promise<void>;
2874
+ private _pendingTransactionsResolve?;
2869
2875
  private pendingUpdates;
2870
2876
  /** True when this bridge is active (SK2 extension installed + iOS 15+) */
2871
2877
  readonly isSK2 = true;
@@ -3058,6 +3064,9 @@ declare namespace CdvPurchase {
3058
3064
  private registeredProducts;
3059
3065
  /** True if "restoreCompleted" or "restoreFailed" should be called when restore is done */
3060
3066
  private needRestoreNotification;
3067
+ /** Resolves when pending transactions from the native queue have been processed */
3068
+ pendingTransactionsReady?: Promise<void>;
3069
+ private _pendingTransactionsResolve?;
3061
3070
  /** List of transaction updates to process */
3062
3071
  private pendingUpdates;
3063
3072
  constructor();
package/www/store.js CHANGED
@@ -1662,7 +1662,7 @@ var CdvPurchase;
1662
1662
  /**
1663
1663
  * Current release number of the plugin.
1664
1664
  */
1665
- CdvPurchase.PLUGIN_VERSION = '13.15.2';
1665
+ CdvPurchase.PLUGIN_VERSION = '13.15.3';
1666
1666
  /**
1667
1667
  * Entry class of the plugin.
1668
1668
  */
@@ -3194,9 +3194,14 @@ var CdvPurchase;
3194
3194
  this.initializeAppReceipt(() => {
3195
3195
  var _a;
3196
3196
  if (!this._receipt) {
3197
- // this should not happen
3198
- this.log.warn('Failed to load the application receipt, cannot proceed with handling the purchase');
3199
- return;
3197
+ // Receipt failed to load — create a minimal receipt so the
3198
+ // transaction can still be tracked and finished. Without this
3199
+ // fallback the Promise would never resolve, leaving the native
3200
+ // transaction unfinished (causing the purchase dialog to loop on
3201
+ // iOS — see #1568).
3202
+ this.log.warn('Application receipt unavailable, creating a fallback receipt to avoid blocking transactions');
3203
+ this._receipt = new AppleAppStore.SKApplicationReceipt({ appStoreReceipt: '', bundleIdentifier: '',
3204
+ bundleShortVersion: '', bundleNumericVersion: 0, bundleSignature: '' }, this.needAppReceipt, this.context.apiDecorators);
3200
3205
  }
3201
3206
  const existing = (_a = this._receipt) === null || _a === void 0 ? void 0 : _a.transactions.find(t => t.transactionId === transactionId);
3202
3207
  if (existing) {
@@ -3358,8 +3363,22 @@ var CdvPurchase;
3358
3363
  });
3359
3364
  }
3360
3365
  loadReceipts() {
3361
- return new Promise((resolve) => {
3362
- setTimeout(() => {
3366
+ return __awaiter(this, void 0, void 0, function* () {
3367
+ // Wait for native pending transactions to be processed before
3368
+ // initializing the receipt. Previously used a fixed 300ms delay
3369
+ // which was unreliable and could miss transactions that arrived
3370
+ // from the native queue (see #1529).
3371
+ //
3372
+ // The pendingTransactionsReady Promise resolves when the native
3373
+ // `processPendingTransactions` call returns, but the per-transaction
3374
+ // callbacks it triggers via evalJs land asynchronously. Yield one
3375
+ // task so those purchased/restored callbacks (and their async
3376
+ // upsertTransaction chain) settle before we snapshot _receipt.
3377
+ if (this.bridge.pendingTransactionsReady) {
3378
+ yield this.bridge.pendingTransactionsReady;
3379
+ yield new Promise(r => setTimeout(r, 0));
3380
+ }
3381
+ return new Promise((resolve) => {
3363
3382
  this.initializeAppReceipt(() => {
3364
3383
  this.receiptsUpdated.call();
3365
3384
  if (this._receipt) {
@@ -3369,7 +3388,7 @@ var CdvPurchase;
3369
3388
  resolve([this.pseudoReceipt]);
3370
3389
  }
3371
3390
  });
3372
- }, 300);
3391
+ });
3373
3392
  });
3374
3393
  }
3375
3394
  canMakePayments() {
@@ -3425,6 +3444,7 @@ var CdvPurchase;
3425
3444
  return;
3426
3445
  }
3427
3446
  this._receipt = new AppleAppStore.SKApplicationReceipt(nativeData, this.needAppReceipt, this.context.apiDecorators);
3447
+ this._appStoreReceiptLoading = false;
3428
3448
  callCallbacks(undefined);
3429
3449
  });
3430
3450
  }
@@ -4217,6 +4237,9 @@ var CdvPurchase;
4217
4237
  protectCall(this.options.ready, 'options.ready');
4218
4238
  protectCall(success, 'init.success');
4219
4239
  this.initialized = true;
4240
+ this.pendingTransactionsReady = new Promise(resolve => {
4241
+ this._pendingTransactionsResolve = resolve;
4242
+ });
4220
4243
  setTimeout(() => this.processPendingTransactions(), 50);
4221
4244
  };
4222
4245
  const setupFailed = (err) => {
@@ -4229,6 +4252,10 @@ var CdvPurchase;
4229
4252
  log('processing pending transactions');
4230
4253
  exec('processPendingTransactions', [], () => {
4231
4254
  this.finalizeTransactionUpdates();
4255
+ if (this._pendingTransactionsResolve) {
4256
+ this._pendingTransactionsResolve();
4257
+ this._pendingTransactionsResolve = undefined;
4258
+ }
4232
4259
  }, undefined);
4233
4260
  }
4234
4261
  purchase(productId, quantity, applicationUsername, discount, success, error) {
@@ -4540,6 +4567,9 @@ var CdvPurchase;
4540
4567
  protectCall(this.options.ready, 'options.ready');
4541
4568
  protectCall(success, 'init.success');
4542
4569
  this.initialized = true;
4570
+ this.pendingTransactionsReady = new Promise(resolve => {
4571
+ this._pendingTransactionsResolve = resolve;
4572
+ });
4543
4573
  setTimeout(() => this.processPendingTransactions(), 50);
4544
4574
  };
4545
4575
  const setupFailed = (err) => {
@@ -4553,6 +4583,10 @@ var CdvPurchase;
4553
4583
  log('processing pending transactions');
4554
4584
  exec('processPendingTransactions', [], () => {
4555
4585
  this.finalizeTransactionUpdates();
4586
+ if (this._pendingTransactionsResolve) {
4587
+ this._pendingTransactionsResolve();
4588
+ this._pendingTransactionsResolve = undefined;
4589
+ }
4556
4590
  }, undefined);
4557
4591
  }
4558
4592
  /**