English 中文(简体)
How to remove ads when user buys in-app purchase [closed]
原标题:
  • 时间:2009-12-21 08:16:47
  •  标签:
  • iphone
  • ads

Closed. This question needs to be more focused. It is not currently accepting answers.


Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 6 years ago.

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.

最佳回答

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.

问题回答

Another approach would be to record the receipt from the SKPaymentTransaction received on purchase or restore. On subsequent launches you could verify that receipt with the app store in the background, re-enable the ads for next launch if necessary.

Verifying Store Receipts documentation

Whilst I don t think this protects you from pasting in a valid user s receipt from elsewhere, it s more difficult to circumvent than toggling a boolean in the NSUserDefaults. Anyone going to this length is unlikely to pay for your app anyway.

Well, this problem is not iphone limited. You should apply one of the many security algorithm. (I don t know how the purchase is done but i ll make a suggestion) You can for example after purchase make the app send the IMEI to the purchase server that will generate a code that the app will save. Then all the app will check for it to enable/disable the ads. (try to make the code with some hashing algorithm or such)

Please remember that all systems can be cracked so don t try something too complex that will give your real user headache.





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签