canOpen
A Boolean value that indicates whether the app can successfully open the configured external purchase link in the current App Store storefront.
Declaration
static var canOpen: Bool { get async }Discussion
Use this method if your app configures the SKExternalPurchaseLink property list key.
Check this property, as shown below, to determine whether your app can successfully call open().
await ExternalPurchaseLink.canOpenIf the result is true, configure any user-interface controls that enable people to open the external purchase link. You configure that link in the SKExternalPurchaseLink property list key in the Info.plist file. There’s no need to call canOpen again, unless the App Store storefront changes. For more information about the App Store storefront, see Storefront.
This property is true if all the following conditions are met:
The current App Store storefront allows external purchase and the person is eligible to make external purchases.
Your app configures the com.apple.developer.storekit.custom-purchase-link.allowed-regions or com.apple.developer.storekit.external-purchase-link entitlement.
Your app configures a link for the current App Store storefront in SKExternalPurchaseLink.
Otherwise, this property is false.
When this property is false, check canMakePayments to determine whether your app can offer in-app purchases using the StoreKit In-App Purchase APIs. For more information, see canMakePayments.