What is the best way to implement In-app purchases

Hi,


I have seen a few online tutorials and I noticed that they used different techniques, some of them uses a singleton class, some of them add the code directly in the main controller, some of them are incomplete (no restore option, no receipt verification) and I was wondering if someone could share his/her current method to implement in-app purchases.


I'm just a little confused as to how many options do I really need to implement when creating in-app purchases or what is expected (restore options, receipt verification etc.).


1- How are you currenlty managing in-app purchases?


2- Is there a cocoapod or a helper class that could make this process easer?


3- Is there a tutorial/book that you would recommend?


Here are two fo the tutorials I have loocked at:


techotopia.com/index.php/An_iOS_8_Swift_In-App_Purchase_Tutorial


raywenderlich.com/122144/in-app-purchase-tutorial


Thanks

Replies

Have you tried MKStoreKit? I've used it in a number of apps over the last 5 years. However, I didn't find it adequate for auto-renewing in-app purchases last time I looked at it due to a lack of local receipt validation (1+ years ago). I didn't find any open source solutions that I felt handled subscriptions well so I ended up writing my own singleton class for IAP. In the end it wasn't bad. The entire implementation file took 200 lines of code.

Looks simple and just what I was looking for but it is written in Objective-c, have you used this library in a Swift project?

I have not, but there's a description of how to use it with swift on its github page.

Thanks a lot for your help!