在App Purchase中,所有设备上都预计iPad Air 2运行8.1.2

时间:2015-01-26 23:54:43

标签: ios ipad in-app-purchase

真的很沮丧, Apple使用以下消息拒绝我的应用程序:

Thank you for your response. We found that the In App Purchase is not accessible when reviewed on iPad Air 2 running iOS 8.1.2, on Wi-Fi and cellular networks.

viewdidload:

        SKPaymentQueue.defaultQueue().addTransactionObserver(self)
if SKPaymentQueue.canMakePayments(){
            let productID:NSSet = NSSet(object:"removeads")
            let request:SKProductsRequest = SKProductsRequest(productIdentifiers: productID)
            request.delegate = self
            request.start()
        }

IAP在其他设备上完美运行,不知道为什么它不能在iPad上运行8.1.2

我从他们发给我的img做了一些调试,并且错误似乎是在这个特殊情况下,IAP数据应该返回产品标识符进行购买,剂量检索。因此,当按下“删除广告”按钮时,它会执行任何操作,我的代码如果有帮助:

删除广告按钮:

   if isConnectedToNetwork()
        {
            btn_removeads.enabled = false
        let payment:SKPayment = SKPayment(product: product)
            if payment.productIdentifier != nil {
        SKPaymentQueue.defaultQueue().addPayment(payment)
            }
            else {
                btn_removeads.enabled = true
                presentViewController(alert2, animated: true, completion: nil) 

//这是弹出的错误,数据尚未收到。

            }
        }
        else {

            presentViewController(alert, animated: true, completion: nil)

        }

REST IAP代码:

 func productsRequest(request: SKProductsRequest!, didReceiveResponse response: SKProductsResponse!){
        let products = response.products
        if products.count != 0
        {
            product = products[0] as SKProduct

        }
    }

    func getProductInfo(){
        if SKPaymentQueue.canMakePayments(){
            let productID:NSSet = NSSet(object:"removeads")
            let request:SKProductsRequest = SKProductsRequest(productIdentifiers: productID)
            request.delegate = self
            request.start()
        }
    }

    func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!){
        for transaction:AnyObject in transactions {
            if let trans:SKPaymentTransaction = transaction as? SKPaymentTransaction{
                switch trans.transactionState {
                case .Purchased:
                    btn_removeads.enabled = true

                    NSUserDefaults.standardUserDefaults().setInteger(1, forKey: "ifads")
                    self.view.userInteractionEnabled = false
                    self.lbl_afterbuy.alpha = 1
                    self.lbl_afterbuy.hidden = false

                    NSUserDefaults.standardUserDefaults().synchronize()

                    SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
                    break
                case .Failed:
                    btn_removeads.enabled = true
                    SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
                    break
                case .Restored:
                    btn_removeads.enabled = true

                    SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
                     SKPaymentQueue.defaultQueue().finishTransaction(transaction as SKPaymentTransaction)
                    break
                default:
                    break
                }

            }
        }
    }

0 个答案:

没有答案