Contents

canMakePayments

A Boolean value that indicates whether the person can make purchases.

Declaration

static var canMakePayments: Bool { get }

Mentioned in

Discussion

Use canMakePayments to determine at runtime whether a person can authorize payments. If the value is false, a person can’t authorize payments, so don’t offer In-App Purchases or external purchases.

The following conditions can cause the value of canMakePayments to be false:

If canMakePayments is true and your app uses only StoreKit In-App Purchase APIs, the person can authorize purchases in the App Store and your app can offer In-App Purchases.

Determine whether to offer purchases for apps that use External Purchase APIs

If your app has the entitlements to use the External Purchase APIs, determine at runtime whether to use the External Purchase API or the In-App Purchase APIs by following these steps, in order:

  1. Check canMakePayments. If canMakePayments is false, don’t offer either external purchases or In-App Purchases. If canMakePayments if true, continue to step 2.

  2. Check the External Purchase API values: canOpen, canPresent, and isEligible. If any value is true, use only the External Purchase APIs to offer external purchases.

  3. If all the values (canOpen, canPresent, and isEligible) are false, and canMakePayments is true, use StoreKit In-App Purchase APIs to offer In-App Purchases.