What a mess that IAP example

Budershank, looks good your clean example :slight_smile:

I also used (couple months back) https://github.com/jtcreative/Corona-SDK-In-App-Purchasing-Module

It’s a bit dated with the UI and all, but the code is simple and still usable.

I have 5 consumable iap do I repeat all this code 5 times or how do I implement the reward please help

I have 5 consumable iap do I repeat all this code 5 times or how do I implement the reward please help

I agree with Xepsdashtx, does each call back eleven handle one, or multiple IAP’s

If you are only looking at the sample app, then you need to also read our guide and tutorial:

http://docs.coronalabs.com/daily/guide/monetization/IAP/index.html

http://coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/

IAP isn’t something that we can write a bunch of drop-iin code for.  Every use case is different.  For example the tutorial above just covers your basic “unlocking all features” type of IAP.  It doesn’t cover consumables, which is talked about a bit in the comments.

If you have multiple items they should all be handled in the one transaction listener function.  You just have to see what product was purchased and build in any logic into that function.  Your code structure is too unpredictable to suggest all the different ways one could present to the user what’s for sale and handle the event that would cause the store.purchase() call to fire.

Rob

I agree with Xepsdashtx, does each call back eleven handle one, or multiple IAP’s

If you are only looking at the sample app, then you need to also read our guide and tutorial:

http://docs.coronalabs.com/daily/guide/monetization/IAP/index.html

http://coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/

IAP isn’t something that we can write a bunch of drop-iin code for.  Every use case is different.  For example the tutorial above just covers your basic “unlocking all features” type of IAP.  It doesn’t cover consumables, which is talked about a bit in the comments.

If you have multiple items they should all be handled in the one transaction listener function.  You just have to see what product was purchased and build in any logic into that function.  Your code structure is too unpredictable to suggest all the different ways one could present to the user what’s for sale and handle the event that would cause the store.purchase() call to fire.

Rob