Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.04 KB

README.md

File metadata and controls

56 lines (37 loc) · 1.04 KB

InAppFramework

In App Purchase Manager framework for iOS

Installation

Cocoapods

pod 'InAppFw' 

Usage

  • Register for Notifications with the name below where you want to do something
ProductPurchasedNotification
  • Add your product identifiers
InAppFw.sharedInstance.addProductId(id: String)

or add multiple of them

InAppFw.sharedInstance.addProductIds(ids: Set<String>)
  • Request products from Apple
InAppFw.sharedInstance.requestProducts(completionHandler: (success:Bool, products:[SKProduct]?) 
  • 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 was valid

  • Purchase product
InAppFw.sharedInstance.purchaseProduct(product: SKProduct)
  • Or Restore products purchased on an other device
InAppFw.sharedInstance.restoreCompletedTransactions()