Skip to content

Commit

Permalink
v13.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
j3k0 committed Sep 29, 2023
1 parent 316d564 commit 8113f31
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 11 deletions.
21 changes: 21 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

## 13.8

### 13.8.5

Fixes for Apple AppStore's introductory periods and
subscription renewals.

#### Load products and receipts in parallel on Apple

This solves the issue with processing the eligibility of
introductory periods.

#### Increase grace period for Apple subscription before refresh

After observing that Apple sometime needs more than a
minute before the API returns the subscription renewal
transaction, we increased the local grace period (time
before refresh) to 90 seconds.

```ts
CdvPurchase.Internal.ExpiryMonitor.GRACE_PERIOD_MS[Platform.APPLE_APPSTORE] = 90000;
```

### 13.8.4

#### Trim product titles on Google Play
Expand Down
13 changes: 13 additions & 0 deletions api/classes/CdvPurchase.AppleAppStore.Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Adapter for Apple AppStore using StoreKit version 1
- [needAppReceipt](CdvPurchase.AppleAppStore.Adapter.md#needappreceipt)
- [pseudoReceipt](CdvPurchase.AppleAppStore.Adapter.md#pseudoreceipt)
- [ready](CdvPurchase.AppleAppStore.Adapter.md#ready)
- [supportsParallelLoading](CdvPurchase.AppleAppStore.Adapter.md#supportsparallelloading)

### Accessors

Expand Down Expand Up @@ -189,6 +190,18 @@ The value is set by the "Adapters" class (which is responsible for initializing

[Adapter](../interfaces/CdvPurchase.Adapter.md).[ready](../interfaces/CdvPurchase.Adapter.md#ready)

___

### supportsParallelLoading

**supportsParallelLoading**: `boolean` = `true`

Set to true if receipts and products can be loaded in parallel

#### Implementation of

[Adapter](../interfaces/CdvPurchase.Adapter.md).[supportsParallelLoading](../interfaces/CdvPurchase.Adapter.md#supportsparallelloading)

## Accessors

### isSupported
Expand Down
13 changes: 13 additions & 0 deletions api/classes/CdvPurchase.Braintree.Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Adapter for a payment or in-app purchase platform
- [options](CdvPurchase.Braintree.Adapter.md#options)
- [products](CdvPurchase.Braintree.Adapter.md#products)
- [ready](CdvPurchase.Braintree.Adapter.md#ready)
- [supportsParallelLoading](CdvPurchase.Braintree.Adapter.md#supportsparallelloading)

### Accessors

Expand Down Expand Up @@ -139,6 +140,18 @@ The value is set by the "Adapters" class (which is responsible for initializing

[Adapter](../interfaces/CdvPurchase.Adapter.md).[ready](../interfaces/CdvPurchase.Adapter.md#ready)

___

### supportsParallelLoading

**supportsParallelLoading**: `boolean` = `false`

Set to true if receipts and products can be loaded in parallel

#### Implementation of

[Adapter](../interfaces/CdvPurchase.Adapter.md).[supportsParallelLoading](../interfaces/CdvPurchase.Adapter.md#supportsparallelloading)

## Accessors

### isSupported
Expand Down
13 changes: 13 additions & 0 deletions api/classes/CdvPurchase.GooglePlay.Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Adapter for a payment or in-app purchase platform
- [name](CdvPurchase.GooglePlay.Adapter.md#name)
- [ready](CdvPurchase.GooglePlay.Adapter.md#ready)
- [retry](CdvPurchase.GooglePlay.Adapter.md#retry)
- [supportsParallelLoading](CdvPurchase.GooglePlay.Adapter.md#supportsparallelloading)
- [\_instance](CdvPurchase.GooglePlay.Adapter.md#_instance)
- [trimProductTitles](CdvPurchase.GooglePlay.Adapter.md#trimproducttitles)

Expand Down Expand Up @@ -135,6 +136,18 @@ Used to retry failed commands

___

### supportsParallelLoading

**supportsParallelLoading**: `boolean` = `false`

Set to true if receipts and products can be loaded in parallel

#### Implementation of

[Adapter](../interfaces/CdvPurchase.Adapter.md).[supportsParallelLoading](../interfaces/CdvPurchase.Adapter.md#supportsparallelloading)

___

### \_instance

`Static` **\_instance**: [`Adapter`](CdvPurchase.GooglePlay.Adapter.md)
Expand Down
13 changes: 13 additions & 0 deletions api/classes/CdvPurchase.Test.Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Test.TEST_PRODUCTS
- [products](CdvPurchase.Test.Adapter.md#products)
- [ready](CdvPurchase.Test.Adapter.md#ready)
- [receipts](CdvPurchase.Test.Adapter.md#receipts)
- [supportsParallelLoading](CdvPurchase.Test.Adapter.md#supportsparallelloading)

### Accessors

Expand Down Expand Up @@ -124,6 +125,18 @@ List of purchase receipts.

[Adapter](../interfaces/CdvPurchase.Adapter.md).[receipts](../interfaces/CdvPurchase.Adapter.md#receipts)

___

### supportsParallelLoading

**supportsParallelLoading**: `boolean` = `true`

Set to true if receipts and products can be loaded in parallel

#### Implementation of

[Adapter](../interfaces/CdvPurchase.Adapter.md).[supportsParallelLoading](../interfaces/CdvPurchase.Adapter.md#supportsparallelloading)

## Accessors

### isSupported
Expand Down
13 changes: 13 additions & 0 deletions api/classes/CdvPurchase.WindowsStore.Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Adapter for a payment or in-app purchase platform
- [products](CdvPurchase.WindowsStore.Adapter.md#products)
- [ready](CdvPurchase.WindowsStore.Adapter.md#ready)
- [receipts](CdvPurchase.WindowsStore.Adapter.md#receipts)
- [supportsParallelLoading](CdvPurchase.WindowsStore.Adapter.md#supportsparallelloading)

### Accessors

Expand Down Expand Up @@ -109,6 +110,18 @@ List of purchase receipts.

[Adapter](../interfaces/CdvPurchase.Adapter.md).[receipts](../interfaces/CdvPurchase.Adapter.md#receipts)

___

### supportsParallelLoading

**supportsParallelLoading**: `boolean` = `false`

Set to true if receipts and products can be loaded in parallel

#### Implementation of

[Adapter](../interfaces/CdvPurchase.Adapter.md).[supportsParallelLoading](../interfaces/CdvPurchase.Adapter.md#supportsparallelloading)

## Accessors

### isSupported
Expand Down
9 changes: 9 additions & 0 deletions api/interfaces/CdvPurchase.Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Adapter for a payment or in-app purchase platform
- [products](CdvPurchase.Adapter.md#products)
- [ready](CdvPurchase.Adapter.md#ready)
- [receipts](CdvPurchase.Adapter.md#receipts)
- [supportsParallelLoading](CdvPurchase.Adapter.md#supportsparallelloading)

### Methods

Expand Down Expand Up @@ -88,6 +89,14 @@ ___

List of purchase receipts.

___

### supportsParallelLoading

**supportsParallelLoading**: `boolean`

Set to true if receipts and products can be loaded in parallel

## Methods

### checkSupport
Expand Down
2 changes: 1 addition & 1 deletion api/modules/CdvPurchase.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ ___

### PLUGIN\_VERSION

`Const` **PLUGIN\_VERSION**: ``"13.8.4"``
`Const` **PLUGIN\_VERSION**: ``"13.8.5"``

Current release number of the plugin.

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-purchase",
"version": "13.8.4",
"version": "13.8.5",
"description": "Cordova Purchase plugin for iOS, Android, Windows (AppStore, Play, UWP)",
"cordova": {
"id": "cordova-plugin-purchase",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-plugin-purchase"
xmlns:android="http://schemas.android.com/apk/res/android"
version="13.8.4">
version="13.8.5">

<name>Purchase</name>
<description>Cordova Purchase plugin for iOS (AppStore), Android (PlayStore) and Windows</description>
Expand Down
2 changes: 1 addition & 1 deletion src/ts/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace CdvPurchase {
/**
* Current release number of the plugin.
*/
export const PLUGIN_VERSION = '13.8.4';
export const PLUGIN_VERSION = '13.8.5';

/**
* Entry class of the plugin.
Expand Down
11 changes: 10 additions & 1 deletion www/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ declare namespace CdvPurchase {
/**
* Current release number of the plugin.
*/
const PLUGIN_VERSION = "13.8.4";
const PLUGIN_VERSION = "13.8.5";
/**
* Entry class of the plugin.
*/
Expand Down Expand Up @@ -1169,6 +1169,10 @@ declare namespace CdvPurchase {
* Load the receipts
*/
loadReceipts(): Promise<Receipt[]>;
/**
* Set to true if receipts and products can be loaded in parallel
*/
supportsParallelLoading: boolean;
/**
* Initializes an order.
*/
Expand Down Expand Up @@ -2399,6 +2403,7 @@ declare namespace CdvPurchase {
private setPaymentMonitor;
private callPaymentMonitor;
initialize(): Promise<IError | undefined>;
supportsParallelLoading: boolean;
loadReceipts(): Promise<Receipt[]>;
private canMakePayments;
/** True iff the appStoreReceipt is already being initialized */
Expand Down Expand Up @@ -3181,6 +3186,7 @@ declare namespace CdvPurchase {
options: AdapterOptions;
constructor(context: Internal.AdapterContext, options: AdapterOptions);
get isSupported(): boolean;
supportsParallelLoading: boolean;
/**
* Initialize the Braintree Adapter.
*/
Expand Down Expand Up @@ -4099,6 +4105,7 @@ declare namespace CdvPurchase {
name: string;
/** Has the adapter been successfully initialized */
ready: boolean;
supportsParallelLoading: boolean;
/** List of products managed by the GooglePlay adapter */
get products(): GProduct[];
private _products;
Expand Down Expand Up @@ -4921,6 +4928,7 @@ declare namespace CdvPurchase {
private log;
constructor(context: Internal.AdapterContext);
get isSupported(): boolean;
supportsParallelLoading: boolean;
initialize(): Promise<IError | undefined>;
loadReceipts(): Promise<Receipt[]>;
loadProducts(products: IRegisterProduct[]): Promise<(Product | IError)[]>;
Expand Down Expand Up @@ -5054,6 +5062,7 @@ declare namespace CdvPurchase {
id: Platform;
name: string;
ready: boolean;
supportsParallelLoading: boolean;
products: Product[];
receipts: Receipt[];
initialize(): Promise<IError | undefined>;
Expand Down
23 changes: 18 additions & 5 deletions www/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,18 @@ var CdvPurchase;
log.info(`${adapter.name} products: ${JSON.stringify(platformProducts)}`);
if (platformProducts.length === 0)
return;
const [loadProductsResult, loadReceiptsResult] = yield Promise.all([
adapter.loadProducts(platformProducts),
adapter.loadReceipts()
]);
let loadProductsResult = [];
let loadReceiptsResult = [];
if (adapter.supportsParallelLoading) {
[loadProductsResult, loadReceiptsResult] = yield Promise.all([
adapter.loadProducts(platformProducts),
adapter.loadReceipts()
]);
}
else {
loadProductsResult = yield adapter.loadProducts(platformProducts);
loadReceiptsResult = yield adapter.loadReceipts();
}
// const loadProductsResult = await adapter.loadProducts(platformProducts);
log.info(`${adapter.name} products loaded: ${JSON.stringify(loadProductsResult)}`);
const loadedProducts = loadProductsResult.filter(p => p instanceof CdvPurchase.Product);
Expand Down Expand Up @@ -1271,7 +1279,7 @@ var CdvPurchase;
/**
* Current release number of the plugin.
*/
CdvPurchase.PLUGIN_VERSION = '13.8.4';
CdvPurchase.PLUGIN_VERSION = '13.8.5';
/**
* Entry class of the plugin.
*/
Expand Down Expand Up @@ -2578,6 +2586,7 @@ var CdvPurchase;
this._products = [];
this.validProducts = {};
this._paymentMonitor = () => { };
this.supportsParallelLoading = true;
/** True iff the appStoreReceipt is already being initialized */
this._appStoreReceiptLoading = false;
/** List of functions waiting for the appStoreReceipt to be initialized */
Expand Down Expand Up @@ -3839,6 +3848,7 @@ var CdvPurchase;
this.ready = false;
this.products = [];
this._receipts = [];
this.supportsParallelLoading = false;
this.context = context;
this.log = context.log.child("Braintree");
this.options = options;
Expand Down Expand Up @@ -4691,6 +4701,7 @@ var CdvPurchase;
this.name = 'GooglePlay';
/** Has the adapter been successfully initialized */
this.ready = false;
this.supportsParallelLoading = false;
this._receipts = [];
/** The GooglePlay bridge */
this.bridge = new GooglePlay.Bridge.Bridge();
Expand Down Expand Up @@ -5667,6 +5678,7 @@ var CdvPurchase;
this.ready = false;
this.products = [];
this.receipts = [];
this.supportsParallelLoading = true;
this.context = context;
this.log = context.log.child("Test");
}
Expand Down Expand Up @@ -6100,6 +6112,7 @@ var CdvPurchase;
this.id = CdvPurchase.Platform.WINDOWS_STORE;
this.name = 'WindowsStore';
this.ready = false;
this.supportsParallelLoading = false;
this.products = [];
this.receipts = [];
}
Expand Down

0 comments on commit 8113f31

Please sign in to comment.