3

I have an application published on play store and it has Admob ads.Now I want to introduce in-app purchase to remove ads.This is the first time I am doing in-app purchase so I don't know much about it.

I have a button which says "Remove Ads" ,what I want is that when the user clicks on this button the app-purchase should open and user makes the payment.The Ads are disabled permanently.The ads should not appear even if the user updates the app. Also tell me how can I set my price to remove the ads.

Tell me this from scratch.

I have my licence key for my app from google play console.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Furqan Hussain
  • 135
  • 1
  • 4
  • 14
  • This question was already asked, check this answer: https://stackoverflow.com/questions/33665600/how-to-make-in-app-purchase-remove-ads –  Nov 12 '17 at 18:53

1 Answers1

1

Just use a flag, if the user did an in app purchase set the flag true, otherwise false. Once the purchase done on all places where the add display's check the flag, if its false then don't display add. The flag itself can for example be stored using SharedPreferences (https://developer.android.com/training/data-storage/shared-preferences.html)

In app purchases and pricing are described here: https://developer.android.com/google/play/billing/billing_admin.html

  • 4
    If the value of the flag is stored in sharedPreferences, won't it get lost if the user decides to uninstall the app and install at a later time? – Nithin Sai Jun 07 '20 at 04:15