Skip to content

Commit 85e6653

Browse files
committed
Update SKRequest+Promise.swift
fix storekit on tvOS
1 parent dfecb15 commit 85e6653

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Categories/StoreKit/SKRequest+Promise.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private class SKDelegate: NSObject, SKProductsRequestDelegate {
2929
let (promise, fulfill, reject) = Promise<SKProductsResponse>.pendingPromise()
3030
var retainCycle: SKDelegate?
3131

32-
#if os(iOS)
32+
#if os(iOS) || os(tvOS)
3333
@objc func request(request: SKRequest, didFailWithError error: NSError) {
3434
reject(error)
3535
retainCycle = nil
@@ -48,7 +48,7 @@ private class SKDelegate: NSObject, SKProductsRequestDelegate {
4848

4949
@objc override class func initialize() {
5050
//FIXME Swift can’t see SKError, so can't do CancellableErrorType
51-
#if os(iOS)
51+
#if os(iOS) || os(tvOS)
5252
NSError.registerCancelledErrorDomain(SKErrorDomain, code: SKErrorCode.PaymentCancelled.rawValue)
5353
#else
5454
NSError.registerCancelledErrorDomain(SKErrorDomain, code: SKErrorPaymentCancelled)

0 commit comments

Comments
 (0)