v13.3.3
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:
- Product is already owned (see
product.owned
) - 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