Skip to content

Commit

Permalink
v13.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
j3k0 committed Oct 4, 2023
1 parent 4a4b16c commit a3c34d7
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 11 deletions.
20 changes: 20 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

## 13.8

### 13.8.6

#### Add CdvPurchase.Utils.platformName()

Convert `CdvPurchase.Platform` enum values to a more user friendly version.

Usage:

```ts
console.log(CdvPurchase.Utils.platformName(myTransaction.platform));

// returns "App Store" or "Google Play" or "Braintree", ....
```

#### Increase expiry monitor's grace period on Google Play

The 10 seconds wait before refreshing an expired subscription on Google Play wasn't enough: increased to 30 seconds.

Ref #1468

### 13.8.5

Fixes for Apple AppStore's introductory periods and
Expand Down
19 changes: 19 additions & 0 deletions api/modules/CdvPurchase.Utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [md5](CdvPurchase.Utils.md#md5)
- [nonEnumerable](CdvPurchase.Utils.md#nonenumerable)
- [objectValues](CdvPurchase.Utils.md#objectvalues)
- [platformName](CdvPurchase.Utils.md#platformname)
- [safeCall](CdvPurchase.Utils.md#safecall)
- [safeCallback](CdvPurchase.Utils.md#safecallback)
- [uuidv4](CdvPurchase.Utils.md#uuidv4)
Expand Down Expand Up @@ -209,6 +210,24 @@ Object.values() for ES6

___

### platformName

**platformName**(`platform`): `string`

Returns human format name for a given platform

#### Parameters

| Name | Type |
| :------ | :------ |
| `platform` | [`Platform`](../enums/CdvPurchase.Platform.md) |

#### Returns

`string`

___

### safeCall

**safeCall**<`T`\>(`logger`, `className`, `callback`, `value`): `void`
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.5"``
`Const` **PLUGIN\_VERSION**: ``"13.8.6"``

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.5",
"version": "13.8.6",
"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.5">
version="13.8.6">

<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 @@ -32,7 +32,7 @@ namespace CdvPurchase {
/**
* Current release number of the plugin.
*/
export const PLUGIN_VERSION = '13.8.5';
export const PLUGIN_VERSION = '13.8.6';

/**
* Entry class of the plugin.
Expand Down
16 changes: 14 additions & 2 deletions www/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ declare namespace CdvPurchase {
}): T[];
}
}
declare namespace CdvPurchase {
namespace Utils {
/** Returns human format name for a given platform */
function platformName(platform: Platform): string;
}
}
declare namespace CdvPurchase {
/**
* @internal
Expand Down Expand Up @@ -657,8 +663,14 @@ declare namespace CdvPurchase {
onVerifiedPurchaseExpired(verifiedPurchase: VerifiedPurchase, receipt: VerifiedReceipt): void;
}
class ExpiryMonitor {
/** Time between */
/** Time between checks for newly expired subscriptions */
static INTERVAL_MS: number;
/**
* Extra time until re-validating an expired subscription.
*
* The platform will take unspecified amount of time to report the renewal via their APIs.
* Values below have been selected via trial-and-error, might require tweaking.
*/
static GRACE_PERIOD_MS: {
[platform: string]: number;
};
Expand Down Expand Up @@ -700,7 +712,7 @@ declare namespace CdvPurchase {
/**
* Current release number of the plugin.
*/
const PLUGIN_VERSION = "13.8.5";
const PLUGIN_VERSION = "13.8.6";
/**
* Entry class of the plugin.
*/
Expand Down
39 changes: 35 additions & 4 deletions www/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,29 @@ var CdvPurchase;
})(Utils = CdvPurchase.Utils || (CdvPurchase.Utils = {}));
})(CdvPurchase || (CdvPurchase = {}));
var CdvPurchase;
(function (CdvPurchase) {
let Utils;
(function (Utils) {
/** Returns human format name for a given platform */
function platformName(platform) {
switch (platform) {
case CdvPurchase.Platform.APPLE_APPSTORE:
return "App Store";
case CdvPurchase.Platform.GOOGLE_PLAY:
return "Google Play";
case CdvPurchase.Platform.WINDOWS_STORE:
return "Windows Store";
case CdvPurchase.Platform.BRAINTREE:
return "Braintree";
case CdvPurchase.Platform.TEST:
return "Test";
default: return platform;
}
}
Utils.platformName = platformName;
})(Utils = CdvPurchase.Utils || (CdvPurchase.Utils = {}));
})(CdvPurchase || (CdvPurchase = {}));
var CdvPurchase;
(function (CdvPurchase) {
/**
* @internal
Expand Down Expand Up @@ -1238,17 +1261,25 @@ var CdvPurchase;
}, ExpiryMonitor.INTERVAL_MS);
}
}
/** Time between */
/** Time between checks for newly expired subscriptions */
ExpiryMonitor.INTERVAL_MS = 10000;
/**
* Extra time until re-validating an expired subscription.
*
* The platform will take unspecified amount of time to report the renewal via their APIs.
* Values below have been selected via trial-and-error, might require tweaking.
*/
ExpiryMonitor.GRACE_PERIOD_MS = {
DEFAULT: 10000,
"ios-appstore": 60000, // Apple takes longer to propagate renewals
DEFAULT: 60000,
"ios-appstore": 60000,
"android-playstore": 30000,
};
Internal.ExpiryMonitor = ExpiryMonitor;
})(Internal = CdvPurchase.Internal || (CdvPurchase.Internal = {}));
})(CdvPurchase || (CdvPurchase = {}));
/// <reference path="types.ts" />
/// <reference path="utils/compatibility.ts" />
/// <reference path="utils/platform-name.ts" />
/// <reference path="validator/validator.ts" />
/// <reference path="log.ts" />
/// <reference path="internal/adapters.ts" />
Expand Down Expand Up @@ -1279,7 +1310,7 @@ var CdvPurchase;
/**
* Current release number of the plugin.
*/
CdvPurchase.PLUGIN_VERSION = '13.8.5';
CdvPurchase.PLUGIN_VERSION = '13.8.6';
/**
* Entry class of the plugin.
*/
Expand Down

0 comments on commit a3c34d7

Please sign in to comment.