Invalid App id

Hey Guys,

I keep getting an invalid app id and after trying almost every I have no idea what to do.

What worked for you guys?

Would you like to see the full code?

Thanks. [import]uid: 23649 topic_id: 16480 reply_id: 316480[/import]

Hey, Jeremy, read this one: http://troybrant.net/blog/2010/01/invalid-product-ids/

If none of the listed items apply to you, try reading through this one: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

I was able to get the valid product back from the iTunes Connect. I have only one product available for sale through In-App Purchase. I’ve confirmed I fetched the valid product using print statement in unpackValidProducts function :

[lua]function unpackValidProducts()
print (">>>>>>>>>>>>>>Loading product list")
if not validProducts then
print(“not validProducts”)
native.showAlert( “In-App features not available”, “initStore() failed”, { “OK” } )
else
print(“looping through the invalidProducts”)
for numLoop=1, #invalidProducts do
native.showAlert( “Item " … invalidProducts[numLoop] … " is invalid.”,{ “OK” } )
end
end
if validProducts then
print("validProducts = " … tostring(validProducts))
print("validProducts[1].title = " … tostring(validProducts[1].title))
print("validProducts[1].description = " … tostring(validProducts[1].description))
print("validProducts[1].price = " … tostring(validProducts[1].price))
print("validProducts[1].productIdentifier = " … tostring(validProducts[1].productIdentifier))
end
end[/lua] [import]uid: 67217 topic_id: 16480 reply_id: 61511[/import]

I’ve done/tried both of the links and I keep getting an invalid product. The product id is from itunes connect, right? If so, why do I need to make a new app id/prov profile if that’s never linked to itunes connect. I feel like I’m missing a major step here.

Thanks. [import]uid: 23649 topic_id: 16480 reply_id: 61639[/import]

Ok so I’ve made (and waited the right amount of time) three different in app ids and they are all turning up invalid, which leads to me the question, where do you get the product id for corona sdk from? Is it from iTunes connects/manage in app purchases or elsewhere?

Thanks. [import]uid: 23649 topic_id: 16480 reply_id: 61912[/import]

Hey Jeremy, did you read through this:

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

App ID – You need to make this at Apple Developer Center. Make sure it’s a unique ID. Refer to the link above about exactly what it means to be *unique*.

Provisional Profile – You need to use a provisional profile for this unique App ID for your device build to test this.

Add your app to iTunes Connect – again refer to the link above.

Add app binary – again refer to the link above.

Add product (i.e., In-App Purchase product) to the app you have in iTunes Connect – again refer to the link above.

Follow all the steps described in the link posted above very carefully, and you should be able to get the valid product back.

If you’ve done all that, and if you’re still getting invalid product, there might be some issue with your own code. I used this template/sample code that @d3mac123 graciously posted here, and it worked really well for me: https://developer.anscamobile.com/forum/2011/10/13/app-purchases-help-needed#comment-60894 [import]uid: 67217 topic_id: 16480 reply_id: 61919[/import]

Do I need to submit a binary if it’s just an update to an app thats already out? Furthermore (Step 3 I believe) uses xcode, which Corona sort of bypasses, so how to do handle that?

Thanks for all your help thus far. [import]uid: 23649 topic_id: 16480 reply_id: 61920[/import]

I don’t think it’s a requirement to use Xcode (but I’m using Xcode, so I can’t be 100% sure). Chris uses iPhone Configuration Utility ( see https://developer.anscamobile.com/forum/2011/10/13/app-purchases-help-needed#comment-61221 )

I don’t know about the update, since this is my first one. Let’s hope someone else will jump in to help you. [import]uid: 67217 topic_id: 16480 reply_id: 61926[/import]

Ok heres the code I’m using:

[code]
local listOfProducts = {

“product”
}

local validProducts, invalidProducts = {}, {}

function unpackValidProducts()
print (“Loading product list”)
if not validProducts then
native.showAlert( “In-App features not available”, “initStore() failed”,"", { “OK” } )
else
for i=1, #invalidProducts do
native.showAlert( “Item " … invalidProducts[i] … " is invalid.”,"",{ “OK” } )
end
end
if validProducts then
for i = 1, validProducts do
native.showAlert( “Item " … validProducts[i] … " is valid.”,"",{ “OK” } )
end
end
end

–XB7EB78Y28.com.streetlightproductions.bounceaball.movingtwos1
function loadProductsCallback( event )
–local alert = native.showAlert( “Loading products”, “Works”, { “Great!”})
validProducts = event.products
invalidProducts = event.invalidProducts
unpackValidProducts ()
end

function savePurchase(product)
–function on what should be save when user buy a product
end

function transactionCallback( event )
if event.transaction.state == “purchased” then
savePurchase(“product”) --you should enter here the product being purchased
elseif event.transcation.state == “restored” then
savePurchase(“product”) --you should enter here the product being purchased
elseif event.transaction.state == “cancelled” then

elseif event.transaction.state == “failed” then
infoString = "Transaction failed, type: ", event.transaction.errorType, event.transaction.errorString
local alert = native.showAlert("Failed ", infoString,{ “OK” })
else
infoString = “Unknown event”
local alert = native.showAlert("Unknown ", infoString,{ “OK” })
end
store.finishTransaction( event.transaction )
end

function setupMyStore (event)
store.loadProducts( listOfProducts, loadProductsCallback )
end

local onComplete = function(event) – 1
local i = event.index
if “clicked” == event.action then --2
if (1 == i) then – 3
–local buyThis = function ( product ) --4
print (“functon buy”)
if store.canMakePurchases then --5
store.purchase( {“com.streetlightproductions.movingtwoone”} )
local alert = native.showAlert("congrats you bought it ", product,{ “OK” })
–levelpacks[1] = “yes”
–saveData()
–dchangeScene(“movingtwo”, “crossfade”)

else --5
native.showAlert(“Store purchases are not available, please try again later”, { “OK” } )
end --5
–end – 4
end --3
– Enter your product id here
–buyThis = (“product”)
end --2
end – 1

store.init(transactionCallback)
setupMyStore()
[/code] [import]uid: 23649 topic_id: 16480 reply_id: 61927[/import]

@Naimi

Thanks for your help thus far, I’m at my witts end here, I think I’m going to give apple a call tomorrow (uses one of those two help things you get) and have them walk me through it if I can’t get it tonight.

I’ll let you know how it goes.

Thanks. [import]uid: 23649 topic_id: 16480 reply_id: 61930[/import]

Hey it’s not longer coming up as inValid, I think my problem was I needed the id for the app and then the id (dumb me) for the in app purchase which I would have never found if it wasn’t for the config/ utility. It’s not coming up as valid but it’s a step forward.

I feel like I owe (Naomi) a favor or two. If theres anything I can do, let me know. [import]uid: 23649 topic_id: 16480 reply_id: 61931[/import]

I’m glad you’ve made a step forward! [import]uid: 67217 topic_id: 16480 reply_id: 61940[/import]

Ya, the main thing was that I needed to test using an AD Hoc profile, I don’t know why it took me so long to figure out that that was way different than a provising profile. [import]uid: 23649 topic_id: 16480 reply_id: 61949[/import]

UGGGG! I just had a huge problem. My update with the in app purchase was just approved and is now live. When testing the in app purchase it worked 100% fine, however, on the live app people are reporting it’s getting an invalid alert (I must have forgotten to remove that in the submitted version).

Anyway is this just apple messing up or is it me, I’m baffled here as it works 100% fine with ad hoc.

Thanks. [import]uid: 23649 topic_id: 16480 reply_id: 63044[/import]

Hey Jeremy, my game app isn’t live (and it’s not ready soon enough for you), so I can’t share my experience with you, but Chris might be able to. I posted a note on his thread here just in case he can shed some light:

http://developer.anscamobile.com/forum/2011/10/15/test-user-account-tap-review-sign-and-complete-information#comment-63053

Naomi

[import]uid: 67217 topic_id: 16480 reply_id: 63054[/import]

Thanks. What I can’t figure out is if there was a problem why would they approve it? Ive heard that it can take up to 24 hours to fully go through but it’s frustrating and I’m sure is costing me some sales. What’s worse is I can’t test it because in my tests it is t broken.

I’ll post if it gets fixed tomorrow but right now I’m frustrated and considering pulling the app due to bugs. [import]uid: 23649 topic_id: 16480 reply_id: 63055[/import]

I figured it out. I have to say in app purchases are awful to set up, even after its working you have to submit them separately to reviewed along with you app, meaning that your app could go live before the in app purchase. One more thing to remember before next time I suppose.

My fix was just submit a new version with the in app for review. Hopefully I won’t get any bad reviews in the next few days.

Thanks again Naomi. [import]uid: 23649 topic_id: 16480 reply_id: 63062[/import]

Hey, Jeremy, thanks for the update!

I totally agree. Setting up the In-App Purchase caused me more grief (and hair-pulling efforts) than any issues I’ve dealt with debugging my code. Sounds like I’d need to watch out for the final review process with the In-App Purchase even after my game is reviewed and approved for release. Sheesh. I don’t want to even think about it right now.

Anyhow, glad to hear you’ve sorted things out. I hope this fiasco won’t cause you any further grief.

Naomi [import]uid: 67217 topic_id: 16480 reply_id: 63064[/import]