Skip to content

Releases: j3k0/cordova-plugin-purchase

v13.4.0

07 Sep 14:09
c193827
Compare
Choose a tag to compare

Product groups and Google Play

Products are now part of the "default" group when none is provided, as per the documentation. This is used on Google Play to automatically replace existing subscription by the newly ordered one.

This update can break your app if you have multiple independent subscription products on Google Play, as purchasing a subscription product will now cancel any existing one by default.

Use the group property in store.register to force legacy subscription products to be part of different groups.

v13.3.3

07 Sep 14:08
a94199e
Compare
Choose a tag to compare

Use canMakePayments on Apple AppStore

offer.canPurchase will be false if the platform reports that it doesn't support the "order" functionality.

When you check if the offer can be purchased, the plugin will now use the value from canMakePurchases (for Apple AppStore).

if (!offer.canPurchase) {
  // the given offer cannot be purchased. hide it or hide the buy button.
}

If none of the offers can be purchased, you can choose to hide the whole store.

There are 2 reasons why an offer cannot be purchased:

  1. Product is already owned (see product.owned)
  2. The adapter don't support "order()"

If you really want to access the low-level value of canMakePurchases you can do it like so:

const appStore = store.getAdapter(CdvPurchase.Platform.APPLE_APPSTORE);
if (appStore && appStore.checkSupport('order')) {
  // user can make payments
}

Ref #1378

v13.3.2

07 Sep 14:08
69b17b3
Compare
Choose a tag to compare

Add support for promotional offers on Apple AppStore

You can order a discount offer by providing additional data to "offer.order()" like so:

offer.order({
  appStore: {
    discount: {
      id: "discount-id",
      key: "...",
      nonce: "...",
      signature: "...",
      timestamp: "...",
    }
  }
});

Check Apple documentation about the meaning of those fields and how to fill them. https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/setting_up_promotional_offers?language=objc

You can check this old example server here: https://github.com/j3k0/nodejs-suboffer-signature-server

v13.3.1

07 Sep 14:07
26a39b5
Compare
Choose a tag to compare

Fix "store.order" promise resolution

Wait for the transaction to be purchased or the purchase cancelled before resolving.

Example usage:

store.order(offer)
  .then((result) => {
    if (result && result.isError) {
      if (result.code === CdvPurchase.ErrorCode.PAYMENT_CANCELLED) {
        // Payment cancelled: window closed by user
      }
      else {
        // Payment failed: check result.message
      }
    }
    else {
      // Success
    }
  });

v13.3.0

07 Sep 14:07
45e17d5
Compare
Choose a tag to compare

Add the AppStore autoFinish option

Use this if the transaction queue is filled with unwanted transactions (in development).
It's safe to keep this option to "true" when using a receipt validation server and you only sell subscriptions

Example:

store.initialize([
  {
    platform: Platform.APPLE_APPSTORE,
    options: { autoFinish: true }
  },
  Platform.GOOGLE_PLAY
]);

Optimize AppStore receipt loaded multiple times in parallel

When the Apple appStoreReceipt is loaded from multiple source, it resulted in a lot of duplicate calls. 13.3.0 optimizes this use case.

Add transactionId and purchaseId to VerifiedPurchase

It's just a TypeScript definition since the plugin doesn't do much with it, but it has been requested by a few users.

v13.2.1

07 Sep 14:06
3895ed5
Compare
Choose a tag to compare

Fixing parsing of incorrectly formatted validator response

v13.2.0

07 Sep 14:06
52906a8
Compare
Choose a tag to compare

Adding store.when().unverified()

unverified will be called when receipt validation failed.

Fixing Product.pricing

Issue #1368 fixed: product.pricing was always undefined.

v13.1.6

07 Sep 14:05
daab2bb
Compare
Choose a tag to compare

Fixing appStoreReceipt null on first launch

Bug hasn't been reproduced, but the fix should handle the error case that happened to this user (based on the provided logs).

v13.1.5

07 Sep 14:05
544e99a
Compare
Choose a tag to compare

AppStore fixes

  • 51400ab Adding in-progress transaction to a pseudo receipt
  • c0e47b3 Reloading receipt from native side before receipt validation
  • 5a8542b Improved error reporting
  • 7a80a6d Do not call "finished" for failed transactions
  • 348431e Report success/failure of purchase
  • e53017c Fix crash when logged out of iCloud (#1354)

v13.1.4

07 Sep 14:04
199511a
Compare
Choose a tag to compare

AppStore fixes

  • b692e21 Don't error if finishing already finished transaction
  • 49c0508 Force receipt refresh after order() and restorePurchases()