2015-05-18 56 views
0

我也在這裏關注此tutorial以實現應用程序購買中的Consumable參考此計算器answerSwift沙箱測試產品未檢索

我的問題是,測試在沙盒iTunes帳戶(在iOS設備上)的應用程序購買沒有得到任何產品。

根據蘋果文檔,我應該在Xcode上進行測試時退出應用商店。如果我是正確的,我不應該使用沙箱帳戶登錄應用商店?

計數變量不大於零,因此將消息打印在else塊中。這是我在我的代碼中設置的應用內購買產品ID。

func productsRequest(request: SKProductsRequest!, didReceiveResponse response: SKProductsResponse!) { 
    println("got the request from apple") 
    var count : Int = response.products.count 
    if count > 0 { 
     var validProducts = response.products 
     var validProduct: SKProduct = response.products[0] as! SKProduct 
     if validProduct.productIdentifier == self.product_id { 
      println(validProduct.localizedTitle) 
      println(validProduct.localizedDescription) 
      println(validProduct.price) 
      buyProduct(validProduct) 
     } else { 
      println(validProduct.productIdentifier) 
     } 

    } else { 
     println("nothing from productsRequest") 
    } 
} 

回答

1

事實證明,您需要在iTunes Connect(協議,稅收和銀行)下有一個活躍的iOS付費應用程序。