I'm searching for a tutorial or an explanation on how to remove advertisement in my application with in-app purchase?
I will put some ads with ad-mob in my app but I also want, that the user can disable the ads when he pays a little donation. Do you know a site or tutorial where I can find a step-by-step explanation how to do this?
Or do I need to publish 2 versions of my app? One with ads and one without ads for paying?
You can simply make a button to make in-app purchase in your application. And, once the user presses the button, starts the in-app process, and removes the ads. Make a flag. It can be in your shared preferences and can be marked true on successful in-app purchase.
Go to your Google Play Developer Console -> Choose your app -> Click In-app Products -> Click on the in-app product and change it from active to inactive.
An in-app purchase is any additional purchase made within an app, like extra lives in a game. You can turn in-app purchases on or off on Apple and Android devices with just a few taps.
Many in-app purchases are optional, but they give users access to additional features that could potentially elevate their experience and engagement with the app. In-app purchases allow developers to offer the app for free in the App Store (for iOS) and Google Play (for Android).
Don't use the SharedPreferences method because if the user flushes the app data or uninstalls/reinstalls your app their ad-free status will be lost.
A couple of ideas:
The two apps approach is simple enough to get the job done too. :)
This presentation seems to explain an example and includes a link to source code at github: http://gotocon.com/dl/2011/GeekNights/Tjen_penge_p%C3%A5_Android_ARH.pdf . It stores the purchased upgrade at a sharedpreference.
However, I'm still looking for a more secure and robust solution that works out the use-case explained here: http://vlingo-en.custhelp.com/app/answers/detail/a_id/1785/~/moving-in-app-purchase-(ad-removal)-to-new-android-phone/p/180
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With