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.

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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

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.

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.

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

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.

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.

Ok heres the code I'm using:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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()

@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.

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.

I'm glad you've made a step forward!

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.

views:2757 update:2011/10/22 17:28:16
corona forums © 2003-2011