SKProductsResponse仅返回无效的产品ID

时间:2016-04-08 22:10:28

标签: ios

我试图连接IAP。该应用程序正在试飞。捆绑包ID和appID是正确的。

    func requestProductData(productIdentifier: String) {

    let pIDS = Set([productIdentifier])

    if SKPaymentQueue.canMakePayments() {
        let request = SKProductsRequest(productIdentifiers: pIDS)
        request.delegate = self
        print("yes") // make sure we can pay
        request.start()
    } else {
        let alert = UIAlertController(title: "In-App Purchases Not Enabled", message: "Please enable In App Purchase in Settings", preferredStyle: UIAlertControllerStyle.Alert)

            alert.addAction(UIAlertAction(title: "Settings", style: UIAlertActionStyle.Default, handler: { alertAction in
            alert.dismissViewControllerAnimated(true, completion: nil)

            let url: NSURL? = NSURL(string: UIApplicationOpenSettingsURLString)
            if url != nil {
                UIApplication.sharedApplication().openURL(url!)
            }

        }))
        alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: { alertAction in
            alert.dismissViewControllerAnimated(true, completion: nil)
        }))
        self.viewController!.presentViewController(alert, animated: true, completion: nil)
    }
}

    func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {

    print("these are the response products: \(response.products)")
    print(response.invalidProductIdentifiers)
    print("received response")

}

我传递直接从iTunes复制的产品ID。权利是正确的。 SKPaymentQueue.canMakePayments()恢复正常,但即使我已经在测试设备上退出商店,它也不会要求我的沙箱ID。

我已经在设备和模拟器上测试了相同的结果。任何帮助都会非常感激!

目前,这就是iTunes中的应用程序内购买情况。我可以提交一个新版本进行审核,但这似乎并不正确,因为此应用程序尚未在应用程序商店中,仅在Test Flight中。

  

您的首次应用内购买必须使用新的应用版本提交。   从应用程序的应用程序内购买部分中选择它,然后单击提交。

^整个指令块完全令人困惑。在阅读我已经在应用程序内购买部分并且没有提交按钮的同时。我已经上传了新版本,但仍然没有提交按钮。

enter image description here

1 个答案:

答案 0 :(得分:3)

我们没有在iTunes Connect的合约部分填写银行帐户信息。您必须填写合同并处理任何要退回的产品。