Unable to get list of products - event.invalidProducts

I have been trying to grab the In-App purchases for around 2 days now, with no success at all.

Let me begin by saying what I have on iTunesConnect:

  • An app added with bundle ID: com.recklessnewmedia.com.dizzyheights
  • In-App purchases created with ‘Product ID’ of: jumpHigher, lowGravity, proGame and widePlatforms
  • I have added these In-App purchases to the app under the ‘App Summary’ page

In my code I have an array of products that I am trying to pull. I have tried a few different formats for the ID here, including the In-App Product ID on it’s own, suffixed with the bundle ID, and suffixed with the bundle ID minus the app name. Below is the code:

[code] – Load products
local listOfProducts =
{
“com.recklessnewmedia.dizzyheights.jumpHigher”,
“com.recklessnewmedia.dizzyheights.lowGravity”,
“com.recklessnewmedia.dizzyheights.proGame”,
“com.recklessnewmedia.dizzyheights.widePlatforms”
}

y = 100
function productCallback( event )
print(“showing valid products”, #event.products)
for i=1, #event.products do
item = display.newText( event.products[i].title, (screenW*0.5), y)
y = y+50
localGroup:insert(item)
print(event.products[i].title)
print(event.products[i].description)
print(event.products[i].price)
print(event.products[i].productIdentifier)
end

print(“showing invalidProducts”, #event.invalidProducts)
for i=1, #event.invalidProducts do
print(event.invalidProducts[i])
end

io.flush() – remove for production
end

store.loadProducts( listOfProducts, productCallback )[/code]

Like I said, I have also tried:

-- Load products local listOfProducts = { "com.recklessnewmedia.jumpHigher", "com.recklessnewmedia.lowGravity", "com.recklessnewmedia.proGame", "com.recklessnewmedia.widePlatforms" }

And:

-- Load products local listOfProducts = { "jumpHigher", "lowGravity", "proGame", "widePlatforms" }

In all cases XCode Console reports:

Oct 19 09:59:18 unknown UIKitApplication:DizzyHeights[0xd11][13191] <notice>: showing invalidProducts 4<br>Oct 19 09:59:18 unknown UIKitApplication:DizzyHeights[0xd11][13191] <notice>: jumpHigher<br>Oct 19 09:59:18 unknown UIKitApplication:DizzyHeights[0xd11][13191] <notice>: widePlatforms<br>Oct 19 09:59:18 unknown UIKitApplication:DizzyHeights[0xd11][13191] <notice>: proGame<br>Oct 19 09:59:18 unknown UIKitApplication:DizzyHeights[0xd11][13191] <notice>: lowGravity

Any help is massively appreciated. I’m at that “about to throw monitor through window” stage with this at the moment.

Thanks [import]uid: 61422 topic_id: 16608 reply_id: 316608[/import]

Hi Mike, I went through a whole load of problem before I got my In-App Purchase working. My problem wasn’t my code, but more to do with setting up my code signing certificate correctly, and then testing it using Ad Hoc build. (I was stupid enough to forever try testing it on dev build).

About the listOfProducts, the first one works. Don’t do the alternative you have described. In other words, stick with the list that starts with com.recklessnewmedia.dizzyheights.jumpHigher

Anyhow, I strongly suggest you read through the following (read the first link first). I’m sure somewhere in there you’ll find what you are missing.

http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

http://troybrant.net/blog/2010/01/invalid-product-ids/

[import]uid: 67217 topic_id: 16608 reply_id: 62105[/import]