-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f24a885
commit 3d51863
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# 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() | ||
``` |