Need Help with IAP(In App Purches

I am kind of a newbie but i have developed an app with AdMob ads in it.I want to add and In-App Purchase (IAP) to remove the ads. How can i perform this function ??/

Thanks in advance 

Hi @ksukrit2001,

One resource to read is the IAP guide here:

https://docs.coronalabs.com/guide/monetization/IAP/index.html

Take care,

Brent

Just to give you a leg up, you’re looking to set up a non-consumable (buy once, keep forever) IAP that when purchased will be used as a flag to turn off the ads.

Basic logic:

  • App starts
  • load saved settings (you need to write this; think JSON encoded table to start; can be more secure, but this is a start)
  • Check for ‘bought IAP flag’.
    • Didn’t buy it?  Turn ads ON.
    • Did buy it? Turn ads OFF.
  • Assuming Ads ON…continue
  • If user click button to buy IAP, try to sell it to them.
  • If they buy it, change your saved settings to reflect this and turn off ads.
  • Now, the next time they start your game, the settings will say ‘turn off ads’ and you can do the right thing.

This will involve three major parts:

  • JSON encoded table to save settings (or alternate solution)
  • IAP purchasing (and restoring) code for a single non-consumable item.
  • Ad code.

Hi @ksukrit2001,

One resource to read is the IAP guide here:

https://docs.coronalabs.com/guide/monetization/IAP/index.html

Take care,

Brent

Just to give you a leg up, you’re looking to set up a non-consumable (buy once, keep forever) IAP that when purchased will be used as a flag to turn off the ads.

Basic logic:

  • App starts
  • load saved settings (you need to write this; think JSON encoded table to start; can be more secure, but this is a start)
  • Check for ‘bought IAP flag’.
    • Didn’t buy it?  Turn ads ON.
    • Did buy it? Turn ads OFF.
  • Assuming Ads ON…continue
  • If user click button to buy IAP, try to sell it to them.
  • If they buy it, change your saved settings to reflect this and turn off ads.
  • Now, the next time they start your game, the settings will say ‘turn off ads’ and you can do the right thing.

This will involve three major parts:

  • JSON encoded table to save settings (or alternate solution)
  • IAP purchasing (and restoring) code for a single non-consumable item.
  • Ad code.