1. 无法获取内购项目
///收到产品返回的信息
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
guard response.products.count > 0 , let product = response.products.first(where: {$0.productIdentifier == self.currenProductId})else {
self.faileCall(.noExist)
return
}
//检测是否允许购买
guard SKPaymentQueue.canMakePayments() else { faileCall(.noPermission); return }
//生成购买对象
let payment = SKPayment(product: product)
//发起购买请求
SKPaymentQueue.default().add(payment)
}
response.products.count
一直为0
- 开发者帐号是否已经完善
付费协议
和税务相关
- 付费项目状态是否为
准备提交
,其中必须上传审核截屏,否则状态为元数据丢失
- APP的套装id是否对应
- 产品id是否对应