0
訂閱iOS自動更新訂閱需要什麼最基本的步驟?iOS:如何訂閱客戶以進行自動更新訂閱
訂閱iOS自動更新訂閱需要什麼最基本的步驟?iOS:如何訂閱客戶以進行自動更新訂閱
想通了。假設你知道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都歡迎