Skip to content

v13.3.3

Compare
Choose a tag to compare
@j3k0 j3k0 released this 07 Sep 14:08
· 155 commits to master since this release
a94199e

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