Contents

paymentQueue(_:shouldAddStorePayment:for:)

Tells the observer when a user initiates an in-app purchase from the App Store.

Declaration

optional func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool

Parameters

  • queue:

    The payment queue the app uses to make the payment request.

  • payment:

    The payment request.

  • product:

    The in-app purchase product.

Mentioned in

Return Value

Return true to continue the transaction in your app.

Discussion

Return false to defer or cancel the transaction.

If you return false, you can continue the transaction later by manually adding the SKPayment payment to the SKPaymentQueue queue.

Discussion

The system calls this delegate method when the user starts an in-app purchase in the App Store, and the transaction continues in your app. Specifically, if your app is already installed, StoreKit calls this method automatically.

If your app isn’t installed when the user starts the in-app purchase in the App Store, the user receives a notification when the app installation is complete. StoreKit calls this method when the user taps the notification. Otherwise, if the user opens the app manually, StoreKit calls this method only if they open the app soon after they initiate the purchase.

For more information, see Promoting In-App Purchases.

See Also

Handling promoted in-app purchases