iOS:如何订阅客户到自动可续订订阅

时间:2016-08-02 01:42:47

标签: ios storekit

订阅iOS自动续订订阅需要哪些最基本的步骤?

1 个答案:

答案 0 :(得分: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)
}

非常欢迎您