我的这段代码在iOS应用中运行良好,但在TVOS Swift中却无法运行
这是我的代码
import StoreKit
SKProductsRequestDelegate, SKPaymentTransactionObserver
let product_id: NSString = "ProductID"
let defaults = UserDefaults.standard
if (SKPaymentQueue.canMakePayments()) {
let productID:NSSet = NSSet(object: self.product_id);
let productsRequest:SKProductsRequest = SKProductsRequest(productIdentifiers: productID as! Set<String>);
productsRequest.delegate = self;
productsRequest.start();
print("Fetching Products");
} else {
print("can't make purchases");
}
但是使用此代码 productsRequest.start(),我无法致电
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {