未从 SKProductsRequest 收到应用内购买 SKProduct

时间:2021-06-22 17:38:35

标签: swift in-app-purchase skproduct

我在 App Store Connect 帐户中有 3 次应用内购买(不可续期订阅),均已在代码中成功获得批准和检索

然后我又添加了一个免费的不可续订的应用内购买,提交到应用商店新的应用内购买被批准,所有协议都有效,税务和银行信息都可以,代码中的产品标识符是与在 App Store 中连接的相同

enter image description here enter image description here enter image description here enter image description here

我在 SKProductsRequest 中请求了所有四个产品但是在 productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) 我收到了三个旧的应用内购买 SKProduct,但是在 invalidProductIdentifiers 中收到了新的应用内购买的产品标识符< /p>

func fetchProducts() {
    let request = SKProductsRequest(productIdentifiers: ["mentalmind.kz.free", "mentalmind.kz.threemonth", "mentalmind.kz.sixmonth", "mentalmind.kz.oneyear"])
    request.delegate = self
    request.start()
}

func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
    print("received products: \(response.products.map({ $0.productIdentifier }))")
    print("invalid product ids: \(response.invalidProductIdentifiers)")
    DispatchQueue.main.async {
        self.products = response.products
    }
}

控制台输出:

received products: ["mentalmind.kz.oneyear", "mentalmind.kz.sixmonth", "mentalmind.kz.threemonth"] 
invalid product ids: ["mentalmind.kz.free"]

是 Apple 的错,还是您有任何代码建议给我?

1 个答案:

答案 0 :(得分:0)

不幸的是我不知道是什么问题,Apple 支持并没有帮助我 但是我以最便宜的价格创建了新的应用内购买,但不是免费的,并且在 App Store Connect 中运行良好 可能是因为应用内购买是免费的