Reputation: 1904
I have followed this tutorial over here to implement a Consumable in app purchase with reference to this stackoverflow answer too.
My problem is that testing the in app purchase on a sandbox iTunes account (on an iOS device) does not get any products.
According to the apple documentation, I am supposed to sign out of the app store while testing it on Xcode. I am not supposed to sign in the app store using the sandbox account if I'm correct?
The count variable is not greater than zero, thus printing the message in the else block. Here is my in app purchase product ID which I set in my code.
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")
}
}
Upvotes: 0
Views: 515
Reputation: 1904
It turns out that you need to have an active iOS Paid Applications under iTunes Connect (Agreements, Tax, and Banking).
Upvotes: 2