IOS Product Identiier

I have the following code for my purchase statement:
[lua]if isAndroid then
store.purchase( {“android.myApp.unlock”} )
else
store.purchase( {“WHAT GOES HERE”} )
end[/lua]

I do not believe that I will have a problem with android. The key is set up as my In-App Product ID on Google Play. However, I am completely stomped on what should go in for the Apple purchase. In iTunes Connect, I have a Reference Name, Product ID, Type, and Apple ID. Which one do I use? [import]uid: 169884 topic_id: 31007 reply_id: 331007[/import]

Hi there,

What you need to put there is the Product ID.

Hope this helps.

  • Andrew [import]uid: 109711 topic_id: 31007 reply_id: 124013[/import]

So iOS takes numbers in brackets, while Android takes a string? Why are they both strings in the sample code, as in does the sample code work with iOS? [import]uid: 169884 topic_id: 31007 reply_id: 124115[/import]

Hi there,

When you call [lua]store.purchase[/lua] you must pass it a table consisting of one or more strings of the IDs of the products you want to buy. I don’t think you can pass a string argument directly. (See http://docs.coronalabs.com/api/library/store/purchase.html). If you want to buy just one product, you have to pass a table containing just one string.

So, for either Android or iOS, it would look like this:

[blockcode]
– Buy one product
store.purchase( {“productID1”} )

– Buy three products
store.purchase( {“productID1”, “productID2”, “productID3”} )

– Alternative way of buying three products
local productList = {“productID1”, “productID2”, “productID3”}
store.purchase( productList )
[/blockcode]

For iOS, the string should be the Product ID you created in iTunes Connect.

Hope this helps.

  • Andrew [import]uid: 109711 topic_id: 31007 reply_id: 124141[/import]

Hi there,

What you need to put there is the Product ID.

Hope this helps.

  • Andrew [import]uid: 109711 topic_id: 31007 reply_id: 124013[/import]

So iOS takes numbers in brackets, while Android takes a string? Why are they both strings in the sample code, as in does the sample code work with iOS? [import]uid: 169884 topic_id: 31007 reply_id: 124115[/import]

Hi there,

When you call [lua]store.purchase[/lua] you must pass it a table consisting of one or more strings of the IDs of the products you want to buy. I don’t think you can pass a string argument directly. (See http://docs.coronalabs.com/api/library/store/purchase.html). If you want to buy just one product, you have to pass a table containing just one string.

So, for either Android or iOS, it would look like this:

[blockcode]
– Buy one product
store.purchase( {“productID1”} )

– Buy three products
store.purchase( {“productID1”, “productID2”, “productID3”} )

– Alternative way of buying three products
local productList = {“productID1”, “productID2”, “productID3”}
store.purchase( productList )
[/blockcode]

For iOS, the string should be the Product ID you created in iTunes Connect.

Hope this helps.

  • Andrew [import]uid: 109711 topic_id: 31007 reply_id: 124141[/import]