In App Purchase Manager framework for iOS
Switch branches/tags
Clone or download
Latest commit f309365 Sep 20, 2016
Permalink
Failed to load latest commit information.
InAppFw.xcodeproj Swift 3 support Sep 20, 2016
InAppFw Swift 3 support Sep 20, 2016
InAppFwTests Swift 3 support Sep 20, 2016
InAppFw.podspec Swift 3 support Sep 20, 2016
LICENSE LICENSE Oct 12, 2015
README.md Add purchase canceled notification Feb 19, 2016

README.md

InAppFramework

In App Purchase Manager framework for iOS

ToDo for 1.0
  • ☐ Documentation!! Work in progress
  • ☐ Change productPurchased(productIdentifier: String) -> Bool to return Tuple with 2 bools to replace hasValidReceipt property
  • ☑︎ Change NSURLConnection to NSURLSession

Installation

CocoaPods

pod 'InAppFw'

Usage

First you should add product IDs:

InAppFw.sharedInstance.addProductId(String)
InAppFw.sharedInstance.addProductIds([String])

Then you can request them from the Apple servers:

InAppFw.sharedInstance.requestProducts(completionHandler: (success: Bool, products: [SKProduct]?)

Make purchases:

InAppFw.sharedInstance.purchaseProduct(SKProduct)

Restore purchases:

InAppFw.sharedInstance.restoreCompletedTransactions()

Register for notifications:

- kIAPPurchasedNotification
- kIAPFailedNotification

Load the previously purchased products:

InAppFw.sharedInstance.loadPurchasedProducts(checkWithApple: Bool, completion: ((valid: Bool) -> Void)?)

checkWithApple: if true, will validate the Purchase receipt with Apple Servers too. The completion will be only true if the receipt is valid.