Skip to content

RomualdPercereau/InAppFramework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Register for Notifications with the name below where you want to do something
ProductPurchasedNotificationName
  • 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()

About

In App Purchase Manager framework for iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 92.5%
  • Ruby 4.1%
  • Objective-C 3.4%