2016-08-02 170 views

回答

1

想通了。假設你知道productID

首先

import StoreKit 

然後在你的代碼

let productID: Set = ["monthly"] 
let request = SKProductsRequest(productIdentifiers: productID) 
request.delegate = self 
request.start() 

,並在SKProductsRequestDelegate

if response.products.count > 0 { 
    let product = response.products[0] 
    let payment = SKPayment(product: product) 
    SKPaymentQueue.defaultQueue().addPayment(payment) 
} 

Your're都歡迎