|
@@ -49,10 +49,12 @@ public protocol PaymentQueue: AnyObject {
|
|
|
|
|
|
func add(_ payment: SKPayment)
|
|
|
|
|
|
+ #if !os(visionOS)
|
|
|
func start(_ downloads: [SKDownload])
|
|
|
func pause(_ downloads: [SKDownload])
|
|
|
func resume(_ downloads: [SKDownload])
|
|
|
func cancel(_ downloads: [SKDownload])
|
|
|
+ #endif
|
|
|
|
|
|
func restoreCompletedTransactions(withApplicationUsername username: String?)
|
|
|
|
|
@@ -193,6 +195,7 @@ class PaymentQueueController: NSObject, SKPaymentTransactionObserver {
|
|
|
paymentQueue.finishTransaction(skTransaction)
|
|
|
}
|
|
|
|
|
|
+ #if !os(visionOS)
|
|
|
func start(_ downloads: [SKDownload]) {
|
|
|
paymentQueue.start(downloads)
|
|
|
}
|
|
@@ -208,9 +211,12 @@ class PaymentQueueController: NSObject, SKPaymentTransactionObserver {
|
|
|
func cancel(_ downloads: [SKDownload]) {
|
|
|
paymentQueue.cancel(downloads)
|
|
|
}
|
|
|
+ #endif
|
|
|
|
|
|
var shouldAddStorePaymentHandler: ShouldAddStorePaymentHandler?
|
|
|
+ #if !os(visionOS)
|
|
|
var updatedDownloadsHandler: UpdatedDownloadsHandler?
|
|
|
+ #endif
|
|
|
|
|
|
|
|
|
// MARK: - SKPaymentTransactionObserver
|
|
@@ -270,9 +276,11 @@ class PaymentQueueController: NSObject, SKPaymentTransactionObserver {
|
|
|
restorePurchasesController.restoreCompletedTransactionsFinished()
|
|
|
}
|
|
|
|
|
|
+ #if !os(visionOS)
|
|
|
func paymentQueue(_ queue: SKPaymentQueue, updatedDownloads downloads: [SKDownload]) {
|
|
|
updatedDownloadsHandler?(downloads)
|
|
|
}
|
|
|
+ #endif
|
|
|
|
|
|
#if !os(watchOS)
|
|
|
func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool {
|