Skip to content

Releases: j3k0/cordova-plugin-purchase

v10.6.1

16 Feb 08:48
fe46e4d
Compare
Choose a tag to compare

Bug fixes:

  • c5fdc88 (android) Fix #1223 - Product with no title
  • 0f828c6 (android) Fix issue in order() when additionalData is undefined

v10.6.0

16 Feb 08:48
c83bf46
Compare
Choose a tag to compare

Use the advanced-http plugin when installed

Receipt validation requests will use the advanced-http plugin when it is installed.

This allows to setup some extra options (like header authentication) and get rid of CORS issues.

See 68a6c3f

Bug fixes

v10.5.4

16 Feb 08:47
d33cdae
Compare
Choose a tag to compare

Add support for custom headers to validator call

store.validatorCustomHeaders can be set to an object containing keys and values of headers to be sent to the receipt validation server.

See 256a10e baae021

Minor changes

  • fb249b6 Adjust validator retry delay
    • When the request to the receipt validator fails, we now increase the retry delay to less agressive values.
  • 91489a4 (android) Query purchase on start every 24h only
    • The plugin used to query for purchases each time the app was sent to foreground.
    • No need to query more often than every 24h, to frequent calls used to causes issues (especially overlapping calls).
    • Ref #1110

Chores

  • 7be2fe6 Upgrade Google Billing Library to v3.0.3
  • eda72d7 (typescript) Integrate the documentation
  • f8bd21d (typescript) Add typings for refresh() return value

Bug fixes

v10.5.2

16 Feb 08:46
5aab884
Compare
Choose a tag to compare
  • 7e9d58b (ios) Fix #1142 - Wrong references to storekit.ERR_*

v10.5.1

16 Feb 08:45
ca656bc
Compare
Choose a tag to compare

v10.5.0

18 Nov 08:56
7a13c00
Compare
Choose a tag to compare

XCode 12 (with support for iOS 14.0 new APIs) is required to use this version of the plugin for iOS.

dd6bf6f Add store.redeem()

Redeems a promotional offer from within the app.

  • On iOS, calling store.redeem() will open the Code Redemption Sheet.
  • This call does nothing on Android and Microsoft UWP.

example usage

    store.redeem();

v10.4.0

17 Nov 08:05
26156ae
Compare
Choose a tag to compare

This release contains fixes for minor bugs and edge cases.

c579e87 Improve use of isExpired collection field

The plugin now better handles the case where the receipt validator reports a subscription as expired using the collection field, even when this happens when validating the application receipt.

In particular, with this change, the expired event will be triggered when subscription expiry is set this way.

c0fc12e (ios) Limit interactive renewals detection to 1 hour

This fixes an issue where, for some users, the receipt was ever-refreshing because the plugin though it just expired, while this happened long ago.

43eff81 (ios) Don't assume in_app array is sorted

in_app used to be sorted chronologically, it's not true anymore. It was a bad assumption anyway.

fba6605 (ios) Fix #1123 - Found nil parameter when creating SKPaymentDiscount

SKPaymentDiscount was mistakenly initiated with nil parameters, which iOS 14.1 started to complain about.

Chores

  • 9193479 Add store.applicationUsername to typescript definitions
  • c1612e6 (ios) Remove "const" from ios-adapter.js
    • Keep the plugin compatible with old javascript engines.

v10.3.0

14 Sep 06:52
d54bf64
Compare
Choose a tag to compare

(android) Upgrade to Google Play Billing Library to 3.0.0

The upgrade to the latest version of Google Play Billing Library comes with some difference, mainly in the native code, but also some new features and modified options.

Subscription proration modes

When upgrading and downgrading a subscription, you can now specify the proration mode, i.e. when and how the replacement will take place.

To support this, the plugin now accepts the prorationMode key in the additionalData passed to the store.order() function. Itis a string that describes the proration mode to apply when upgrading/downgrading a subscription with oldSku on Android. See https://developer.android.com/google/play/billing/subs#change

Possible values:

  • DEFERRED - Replacement takes effect when the old plan expires, and the new price will be charged at the same time.
  • IMMEDIATE_AND_CHARGE_PRORATED_PRICE - Replacement takes effect immediately, and the billing cycle remains the same.
  • IMMEDIATE_WITHOUT_PRORATION - Replacement takes effect immediately, and the new price will be charged on next recurrence time.
  • IMMEDIATE_WITH_TIME_PRORATION - Replacement takes effect immediately, and the remaining time will be prorated and credited to the user.

Removing developerPayload

developerPayload isn't supported anymore with Billing Library v3. See https://developer.android.com/google/play/billing/developer-payload

Update the subscription upgrade / downgrade

The new version now requires the oldPurchaseToken next to the oldSku to upgrade a subscription. This is a random string that identifies a purchase. The plugin is smart enough to figure it out for you when upgrading a subscription so there shouldn't be a reason to update your code.

However, it's now possible to force the value for this parameter (in case you have a doubt whether the running instance of your app doesn't have the latest data, this might safeguard against a unwanted upgrade).

(all) Add .failed and .cancelled to refresh() return value

Allows apps to display some UI element while the refresh() operation is in progress.

Disable retrying validator for expired subscription

This code dates from the era before Apple was returning the latest_receipt_info in the validator. There is no need to refresh the receipt anymore to make sure we have the latest info.

Bugs

  • (ios) Fix #1066 bug readonly property with WKWebView
  • (ios) #1092 Disable appStoreReceipt refresh on purchase
    • Calling refreshReceipt on iOS was triggering an unecessary password prompt, different from the fingerprint validation required by a purchase.

v10.2.0

13 Sep 09:57
238b659
Compare
Choose a tag to compare

(all) Add product.device to validation requests

This will extend the info already retrieved from cordova-plugin-device. See f636bcf

(android) Upgrade play billing library to 2.2.0

See f0da787

(all) Set ineligibleForIntroPrice to all group members

When a product is ineligible for introductory price, all members of the subscriptions group should be ineligible as well. See fc1b39e

v10.1.2

15 May 06:28
d4bc029
Compare
Choose a tag to compare

Add promise-like return value to store.refresh

store.refresh() now returns a promise-like object with the following functions:

  • .completed(fn) - Calls fn when the queue of previous purchases have been processed. At this point, all previously owned products should be in the approved state.
  • .finished(fn) - Calls fn when all purchased in the approved state have been finished or expired.

In the case of the restore purchases call, you will want to hide any progress bar when the finished callback is called.

<button onclick="restorePurchases()">Restore Purchases</button>
function restorePurchases() {
   showProgress();
   store.refresh().finished(hideProgress);
}