Warm tip: This article is reproduced from serverfault.com, please click

Listening for "Promoting Your In-App Purchases" event within the application

发布于 2020-11-30 07:32:23

We offer and support the subscription product on the App Store page of the application as follows.

https://developer.apple.com/app-store/promoting-in-app-purchases/

When the user clicks the "subscribe" button on the product here, the application opens and the Apple purchases window opens. However, in this flow, I want to add a parental control without opening Apple's purchase window, and if successful, the window for purchasing from Apple will open.

My question is; How can I listen to this process when the application is opened by clicking the buy button from the App Store?

Questioner
enjektor0
Viewed
0
umitx 2020-11-30 15:48:56

You can use the following method in SKPaymentTransactionObserver and return "true" if the result of the parental control is true;

func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool {
    return true
}