Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandorgyulai/InAppFramework
In App Purchase Manager framework for iOS
https://github.com/sandorgyulai/InAppFramework
Last synced: 7 days ago
JSON representation
In App Purchase Manager framework for iOS
- Host: GitHub
- URL: https://github.com/sandorgyulai/InAppFramework
- Owner: sandorgyulai
- License: mit
- Created: 2015-10-12T14:22:20.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-11T16:08:36.000Z (about 6 years ago)
- Last Synced: 2024-11-08T00:38:10.715Z (about 1 month ago)
- Language: Swift
- Size: 27.3 KB
- Stars: 40
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - InAppFramework - In App Purchase Manager framework for iOS. (Payments / Other Parsing)
- awesome-ios-star - InAppFramework - In App Purchase Manager framework for iOS. (Payments / Other Parsing)
- awesome-swift-cn - InAppFw - In App Purchase Manager framework. (Libs / App Store)
README
# InAppFramework
In App Purchase Manager framework for iOS### Disclaimer
I know it's been too long since the last update, quite a few things happened in my life, but now I am back again and started with a nice update for Swift 4.2 compatibility. More to come, stay tuned!##### 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:
```swift
InAppFw.sharedInstance.addProductId(String)
InAppFw.sharedInstance.addProductIds([String])
```Then you can request them from the Apple servers:
```swift
InAppFw.sharedInstance.requestProducts(completionHandler: (success: Bool, products: [SKProduct]?)
```Make purchases:
```swift
InAppFw.sharedInstance.purchaseProduct(SKProduct)
```Restore purchases:
```swift
InAppFw.sharedInstance.restoreCompletedTransactions()
```Register for notifications:
```swift
- kIAPPurchasedNotification
- kIAPFailedNotification
```Load the previously purchased products:
```swift
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.