In-App Purchase codes

Hi there,

Does anyone has sample codes you can share ?  I have 1 product and the customers can either try before they buy . They can click on the “Buy Now” button to buy the “full_version” product . If they have already purchased the product, they will not see the “Buy Now” button ?

Do you have any codes that hide the “Buy Now” button if customers have already purchased the product ?

thanks

Are you using a third-party library like GGData or something you made on your own to keep track of your game´s progress?

If yes then you just have to add a variable like “fullGameUnlocked” and set it to true as soon as the player buys this item - then you can add an if-statement in your createScene function.

If not then I recommend to checkout this https://developer.coronalabs.com/code/ggdata

Hi CineTek,

Thanks for a quick reply. I am not keeping track of game’s progress . I just want to know if the users have already purchased the app so I no longer display the “Buy Product” button . For example, the first time the users try  a lite version, they will see a “Buy Upgrade” button to upgrade the app  . Once they have paid for it, they should no longer see the button again . One way to keep track of this is to write to the text file . I just want to ask around to see if you guys have better options. Look like ggdata you mention above can also be used for this purpose ?

thanks

Yes, GGData is for writing data to a file :wink:

I do not see any better options, it is easy to implement and you can just add it to your save file or GGData file

Are you using a third-party library like GGData or something you made on your own to keep track of your game´s progress?

If yes then you just have to add a variable like “fullGameUnlocked” and set it to true as soon as the player buys this item - then you can add an if-statement in your createScene function.

If not then I recommend to checkout this https://developer.coronalabs.com/code/ggdata

Hi CineTek,

Thanks for a quick reply. I am not keeping track of game’s progress . I just want to know if the users have already purchased the app so I no longer display the “Buy Product” button . For example, the first time the users try  a lite version, they will see a “Buy Upgrade” button to upgrade the app  . Once they have paid for it, they should no longer see the button again . One way to keep track of this is to write to the text file . I just want to ask around to see if you guys have better options. Look like ggdata you mention above can also be used for this purpose ?

thanks

Yes, GGData is for writing data to a file :wink:

I do not see any better options, it is easy to implement and you can just add it to your save file or GGData file