Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove ads when user buys in-app purchase [closed]

Tags:

iphone

ads

I have an app that I want users to be able to pay a small fee to remove ads from. I figure the best way to do this (the app needs to remain free) is via an in-app purchase. I'm wondering however the best way to go about removing the ads and how to do it once the user has bought the upgrade. Any help or advice would be great thanks.

like image 326
Graeme Avatar asked Dec 21 '09 08:12

Graeme


People also ask

How do I get rid of in-app purchase ads?

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.

What does disabling in-app purchases do?

Disabling in-app purchases can help you resist temptation to spend money while using an app, or keep kids from accidentally charging your credit card.

Can you disable in-app purchases?

You can turn in-app purchases on or off in the Settings app on Apple devices and in the Play Store app on Android devices.

What does in-app purchase ads mean?

In-app purchases allow developers to offer the app for free in the App Store (for iOS) and Google Play (for Android). Then, within the application, they can upsell and advertise paid upgrades, locked features, special items, and other premium offers.


1 Answers

A boolean in NSUserDefaults seems like the right bet. You can check it on launch to see if ads should display, have the app hide or show ads accordingly, and set it to the appropriate value when the user pays to disable it.

Edited to add:

Just saw this on the dev forums. If you're especially concerned about users on jailbroken devices fiddling with your NSUserDefaults boolean, you could alternatively store the data using keychain. Keychain can't be meddled with in the same way NSUserDefaults can. More details at that link.

I don't generally believe in expending much effort at all on anti-piracy stuff but this is an easy way to cover yourself that doesn't cost terribly much more than using NSUserDefaults.

like image 50
Danilo Campos Avatar answered Sep 22 '22 01:09

Danilo Campos