Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS In-App Purchase No Back-end

I am investigating the use of in-app purchase for what essentially would be a "pro" version of my app. The app itself would be free but once in the user has the option to purchase the pro content (only 1 thing). The "pro" content would already be on the app and there is no need to download it, it would simply "unlock" it.

  1. Is this allowed from the Apple Guidelines?
  2. As only 1 non-consumable would be purchased I think the use of a back-end server isn't required.
    • Again is that allowed from the guidelines?
    • And is it safe and simple to just store the result in NSUserDefaults and if installed on another device pull it from SKPayment restore purchased and such?

I've looked at several other questions.

  • In-App Purchasing?
  • Retrieve purchased information in In-App purchase
  • How do I add consumable In App Purchases using NSUserDefaults and not my own server?

And those seem to suggest that my approach is valid, but as I know those things have changed recently I want to make sure I'm taking the right approach.

Thanks!

like image 563
glesage Avatar asked Mar 15 '13 16:03

glesage


2 Answers

  1. No problem having the content built in.

  2. Best practice is to perform receipt verification on a server with an authentication protocol between the app and server (this is also true for several other mobile app stores). If you perform the verification on the device, people can use existing tools to get around your IAP checking and steal content. Take a look at https://developer.apple.com/library/ios/#releasenotes/StoreKit/IAP_ReceiptValidation/ for some information.

So while a server is not required, it is recommended. Only you can say if protecting your content is worth the hassle of maintaining a server.

I agree with J. Freeman that straight storage in NSUserDefaults seems weak. I store things in a local file but the format is tied to the device and requires a server computed key to create it. Finally, yes you should use SKPaymentQueue restoreCompletedTransactions to get things purchased on another device. Realize that the restored transactions should also have their receipts verified on your server.

like image 93
DrC Avatar answered Oct 09 '22 17:10

DrC


Yes that is fine. You do not need a backend to do in-app purchases, and it is ok to ship with your content built in.

The one thing I would say be careful with though is storing the unlock information in NSUserDefaults as someone will easily be able to forge purchases that way. You should store the unlock information in the keychain.

like image 44
Jack Freeman Avatar answered Oct 09 '22 16:10

Jack Freeman