@@ -271,7 +272,7 @@
Declaration
-
Undocumented
+
If the state is succeeded
, returns the number of purchases that have been updated.
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Usage.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Usage.html
index 535a067..832c8f7 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Usage.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Usage.html
@@ -23,7 +23,7 @@
- (77% documented)
+ (95% documented)
Displaying products with purchases
In your store screen, where you present your products titles and prices with a purchase button, there are some cases to handle that we skipped. Owned products and deferred purchases.
-
Owned products
+
Owned products
-
Non-consumables and active auto-renewing subscriptions cannot be purchased again. You should adjust your UI to reflect that state. Refer to InAppPurchase.hasActivePurchase()
to and to the example later in this section.
-
Deferred purchases
+
Non-consumables and active auto-renewing subscriptions cannot be purchased again. You should adjust your UI to reflect that state. Refer to InAppPurchase.hasActivePurchase()
to the example later in this section.
+
Deferred purchases
Apple’s Ask to Buy feature lets parents approve any purchases initiated by children, including in-app purchases.
@@ -187,7 +187,7 @@
Deferred purchases
We will use the hasDeferredTransaction
method:
InAppPurchase.hasDeferredTransaction(for productIdentifier: String) -> Bool
-
Example
+
Example
Here’s an example that covers what has been discussed above. We will update our example refreshView
function from before:
@objc func refreshView() {
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-products.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-products.html
index cc50b1f..9413128 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-products.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-products.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Displaying products
Let’s start with the simplest case: you have a single product.
-You can retrieve all information about this product using the function InAppPurchase.getProductBy(identifier: "my_product_id")
. This returns an SKProduct extended with helpful methods.
+You can retrieve all information about this product using the function InAppPurchase.getProductBy(identifier: "my_product_id")
. This returns an SKProduct extended with helpful methods.
Those are the most important:
@@ -173,7 +173,7 @@ Displaying products
productIdentifier: String
- The string that identifies the product to the Apple AppStore.
localizedTitle: String
- The name of the product, in the language of the device, as retrieved from the AppStore.
localizedDescription: String
- A description of the product, in the language of the device, as retrieved from the AppStore.
-localizedPrice: String
- The cost of the product in the local currency (read-only property added by this library).
+localizedPrice: String
- The cost of the product in the local currency (read-only property added by this library, available for OSX >= 10.13.2 and iOS >= 11.2).
Example:
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-subscriptions.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-subscriptions.html
index 640c8ff..6d7bbdf 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-subscriptions.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/displaying-subscriptions.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Displaying subscriptions
-For subscription products, you also have some data about subscription periods and introductory offers.
+You can retrieve all information about a product using the function InAppPurchase.getProductBy(identifier: "my_product_id")
. This returns an SKProduct extended with helpful methods.
+
+Those are the most important:
+
+
+productIdentifier: String
- The string that identifies the product to the Apple AppStore.
+localizedTitle: String
- The name of the product, in the language of the device, as retrieved from the AppStore.
+localizedDescription: String
- A description of the product, in the language of the device, as retrieved from the AppStore.
+localizedPrice: String
- The cost of the product in the local currency (read-only property added by this library, available for OSX >= 10.13.2 and iOS >= 11.2).
+
+
+For subscription products, you also have some data about subscription periods and introductory offers. (read-only property added by this library, available for OSX >= 10.13.2 and iOS >= 11.2)
func hasIntroductoryPriceEligible() -> Bool
- The product has an introductory price the user is eligible to.
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/errors.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/errors.html
index 33fa397..c33344b 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/errors.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/errors.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Features
Getting Started
If you haven’t already, I highly recommend your read the Overview and Preparing section of Apple’s In-App Purchase official documentation.
+Requirements
+
+
+- Configure your App and Xcode to support In-App Purchases.
+
+
+- Create and configure your Fovea.Billing project account:
+
+
+- Set your bundle ID
+- The iOS Shared Secret (or shared key) is to be retrieved from AppStoreConnect
+- The iOS Subscription Status URL (only if you want subscriptions)
+
+
Installation
@@ -190,97 +206,58 @@ Installation
- Go to the section Swift Package
- Click on (+) Add Package Dependency
- Copy the Git URL: https://github.com/iridescent-dev/iap-swift-lib.git
-- Click on Next > Next
+- Click on Next
+- In Rules select Version: Up to Next Major …
+- Click on Next
- Make sure your project is selected in Add to target
- Click on Finish
Note: You have to import InAppPurchaseLib
wherever you use the library.
-Micro Example
-
/** AppDelegate.swift */
-import UIKit
-import InAppPurchaseLib
-
-@UIApplicationMain
-class AppDelegate: UIResponder, UIApplicationDelegate {
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
- // Initialize the library
- InAppPurchase.initialize(
- iapProducts: [
- IAPProduct(productIdentifier: "my_product", productType: .nonConsumable)
- ],
- validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678"
- )
- return true
- }
+Basic Usage
- func applicationWillTerminate(_ application: UIApplication) {
- // clean
- InAppPurchase.stop()
- }
+
+Initialize the library
+InAppPurchase.initialize(
+iapProducts: [ IAPProduct(productIdentifier: "my_product", productType: .nonConsumable) ],
+validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678"
+)
+
+Stop library when the application will terminate
+func applicationWillTerminate(_ application: UIApplication) {
+InAppPurchase.stop()
}
-
-/** ViewController.swift */
-import UIKit
-import StoreKit
-import InAppPurchaseLib
-
-class ViewController: UIViewController {
- private var loaderView = LoaderView()
- @IBOutlet weak var statusLabel: UILabel!
- @IBOutlet weak var productTitleLabel: UILabel!
- @IBOutlet weak var productDescriptionLabel: UILabel!
- @IBOutlet weak var purchaseButton: UIButton!
- @IBOutlet weak var restorePurchasesButton: UIButton!
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Add action for purchases and restore butons.
- purchaseButton.addTarget(self, action: #selector(self.purchase), for: .touchUpInside)
- restorePurchasesButton.addTarget(self, action: #selector(self.restorePurchases), for: .touchUpInside)
- }
-
- override func viewWillAppear(_ animated: Bool) {
- self.refreshView()
- InAppPurchase.refresh(callback: { _ in
- self.refreshView()
- })
- }
-
- func refreshView() {
- guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product") else {
- self.productTitleLabel.text = "Product unavailable"
- return
- }
- // Display product information.
- productTitleLabel.text = product.localizedTitle
- productDescriptionLabel.text = product.localizedDescription
- purchaseButton.setTitle(product.localizedPrice, for: .normal)
-
- // Disable the button if the product has already been purchased.
- if InAppPurchase.hasActivePurchase(for: "my_product") {
- statusLabel.text = "OWNED"
- purchaseButton.isPointerInteractionEnabled = false
- }
- }
-
- @IBAction func purchase(_ sender: Any) {
- self.loaderView.show()
- InAppPurchase.purchase(
- productIdentifier: "my_product",
- callback: { result in
- self.loaderView.hide()
- })
- }
-
- @IBAction func restorePurchases(_ sender: Any) {
- self.loaderView.show()
- InAppPurchase.restorePurchases(callback: { result in
- self.loaderView.hide()
- })
- }
+
+Display product information
+guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product") else { return }
+productTitleLabel.text = product.localizedTitle
+productDescriptionLabel.text = product.localizedDescription
+productPriceLabel.text = product.localizedPrice
+
+Initialize a purchase
+@IBAction func purchase(_ sender: Any) {
+self.loaderView.show()
+InAppPurchase.purchase(
+productIdentifier: "my_product",
+callback: { result in
+ self.loaderView.hide()
+})
}
-
+
+Unlock purchased content
+if InAppPurchase.hasActivePurchase(for: "my_product") {
+// display content related to the product
+}
+
+Restore purchases
+@IBAction func restorePurchases(_ sender: Any) {
+self.loaderView.show()
+InAppPurchase.restorePurchases(callback: { result in
+self.loaderView.hide()
+})
+}
+
+
Documentation
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/micro-example.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/micro-example.html
index 3ae38ac..2b8d48b 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/micro-example.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/micro-example.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Micro Example
}
func applicationWillTerminate(_ application: UIApplication) {
-
// Clean
+
// Stop library when the application will terminate
InAppPurchase.stop()
}
}
@@ -229,6 +229,7 @@
Micro Example
}
}
+
// Initiating a purchase
@IBAction func purchase(_ sender: Any) {
self.loaderView.show()
InAppPurchase.purchase(
@@ -238,6 +239,7 @@
Micro Example
})
}
+
// Restoring purchases
@IBAction func restorePurchases(_ sender: Any) {
self.loaderView.show()
InAppPurchase.restorePurchases(callback: { result in
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/purchasing.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/purchasing.html
index 7a6996c..3e7ceb4 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/purchasing.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/purchasing.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Purchasing
finalizing transactions when product delivery is complete
sending purchase request, for which successful doesn’t always mean complete
-
Initiating a purchase
+
Initiating a purchase
To initiate a purchase, use the InAppPurchase.purchase()
function. It takes the productIdentifier
and a callback
function, called when the purchase has been processed.
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/refreshing.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/refreshing.html
index 56e094a..0897f2b 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/refreshing.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/refreshing.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Undocumented
","parent_name":"IAPErrorProtocol"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21libraryNotInitializedyA2CmF":{"name":"libraryNotInitialized","abstract":"
You must call the initialize
fuction before using the library.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO23bundleIdentifierInvalidyA2CmF":{"name":"bundleIdentifierInvalid","abstract":"
The Bundle Identifier is invalid.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO19validatorUrlInvalidyA2CmF":{"name":"validatorUrlInvalid","abstract":"
The Validator URL String is invalid.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO20refreshReceiptFailedyA2CmF":{"name":"refreshReceiptFailed","abstract":"
Failed to refresh the App Store receipt.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21validateReceiptFailedyA2CmF":{"name":"validateReceiptFailed","abstract":"
Failed to validate the App Store receipt with Fovea.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17readReceiptFailedyA2CmF":{"name":"readReceiptFailed","abstract":"
Failed to read the receipt validation.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21refreshProductsFailedyA2CmF":{"name":"refreshProductsFailed","abstract":"
Failed to refresh products from the App Store.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO15productNotFoundyA2CmF":{"name":"productNotFound","abstract":"
The product was not found on the App Store and cannot be purchased.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO010cannotMakeC0yA2CmF":{"name":"cannotMakePurchase","abstract":"
The user is not allowed to authorize payments.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17alreadyPurchasingyA2CmF":{"name":"alreadyPurchasing","abstract":"
A purchase is already in progress.
","parent_name":"IAPErrorCode"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV4codeAA0E4CodeOvp":{"name":"code","abstract":"
The error code.
","parent_name":"IAPError"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV20localizedDescriptionSSvp":{"name":"localizedDescription","abstract":"
The error description.
","parent_name":"IAPError"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO9succeededyA2CmF":{"name":"succeeded","abstract":"
Refresh was successful.
","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO6failedyA2CmF":{"name":"failed","abstract":"
Refresh failed.
","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO7skippedyA2CmF":{"name":"skipped","abstract":"
Refresh has been skipped because it is not necessary.
","parent_name":"IAPRefreshResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9purchasedyA2CmF":{"name":"purchased","abstract":"
The purchase was successful.
","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO6failedyA2CmF":{"name":"failed","abstract":"
Puchase failed.
","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9cancelledyA2CmF":{"name":"cancelled","abstract":"
The purchase was cancelled by the user.
","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO8deferredyA2CmF":{"name":"deferred","abstract":"
The purchase is deferred.
","parent_name":"IAPPurchaseResultState"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV5stateAA0eF5StateOvp":{"name":"state","abstract":"
Undocumented
","parent_name":"IAPRefreshResult"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV8iapErrorAA8IAPErrorVSgvp":{"name":"iapError","abstract":"
Undocumented
","parent_name":"IAPRefreshResult"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV14addedPurchasesSivp":{"name":"addedPurchases","abstract":"
Undocumented
","parent_name":"IAPRefreshResult"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV16updatedPurchasesSivp":{"name":"updatedPurchases","abstract":"
Undocumented
","parent_name":"IAPRefreshResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV5stateAA0eF5StateOvp":{"name":"state","abstract":"
Undocumented
","parent_name":"IAPPurchaseResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV8iapErrorAA8IAPErrorVSgvp":{"name":"iapError","abstract":"
Undocumented
","parent_name":"IAPPurchaseResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV7skErrorSC11SKErrorCodeLeVSgvp":{"name":"skError","abstract":"
Undocumented
","parent_name":"IAPPurchaseResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV20localizedDescriptionSSSgvp":{"name":"localizedDescription","abstract":"
Undocumented
","parent_name":"IAPPurchaseResult"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO5shortyA2CmF":{"name":"short","abstract":"
Undocumented
","parent_name":"IAPPeriodFormat"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO4longyA2CmF":{"name":"long","abstract":"
Undocumented
","parent_name":"IAPPeriodFormat"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE21localizedPeriodFormatAC09IAPPeriodH0OvpZ":{"name":"localizedPeriodFormat","abstract":"
Undocumented
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE28hasIntroductoryPriceEligibleSbyF":{"name":"hasIntroductoryPriceEligible()","abstract":"
Checks if the product has an introductory price the user is eligible to.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE14localizedPriceSSvp":{"name":"localizedPrice","abstract":"
Returns a localized string with the cost of the product in the local currency.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE27localizedSubscriptionPeriodSSSgvp":{"name":"localizedSubscriptionPeriod","abstract":"
Returns a localized string with the period of the subscription product.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE26localizedIntroductoryPriceSSSgvp":{"name":"localizedIntroductoryPrice","abstract":"
Returns a localized string with the introductory price if available, in the local currency.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE27localizedIntroductoryPeriodSSSgvp":{"name":"localizedIntroductoryPeriod","abstract":"
Returns a localized string with the introductory price period of the subscription product.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE29localizedIntroductoryDurationSSSgvp":{"name":"localizedIntroductoryDuration","abstract":"
Returns a localized string with the duration of the introductory price.
","parent_name":"SKProduct"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO10consumableyA2CmF":{"name":"consumable","abstract":"
Undocumented
","parent_name":"IAPProductType"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO13nonConsumableyA2CmF":{"name":"nonConsumable","abstract":"
Undocumented
","parent_name":"IAPProductType"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO23nonRenewingSubscriptionyA2CmF":{"name":"nonRenewingSubscription","abstract":"
Undocumented
","parent_name":"IAPProductType"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO25autoRenewableSubscriptionyA2CmF":{"name":"autoRenewableSubscription","abstract":"
Undocumented
","parent_name":"IAPProductType"},"Structs/IAPProduct.html#/s:16InAppPurchaseLib10IAPProductV17productIdentifierSSvp":{"name":"productIdentifier","abstract":"
The identifier of the product.
","parent_name":"IAPProduct"},"Structs/IAPProduct.html#/s:16InAppPurchaseLib10IAPProductV11productTypeAA0eG0Ovp":{"name":"productType","abstract":"
The type of the product.
","parent_name":"IAPProduct"},"Structs/IAPProduct.html#/s:16InAppPurchaseLib10IAPProductV17productIdentifier0F4TypeACSS_AA0eH0Otcfc":{"name":"init(productIdentifier:productType:)","abstract":"
Initializes an IAPProduct
with its identifier and type.
","parent_name":"IAPProduct"},"Protocols/IAPPurchaseDelegate.html#/s:16InAppPurchaseLib19IAPPurchaseDelegateP16productPurchased0G10IdentifierySS_tF":{"name":"productPurchased(productIdentifier:)","abstract":"
Called when a product is newly purchased, updated or restored.
","parent_name":"IAPPurchaseDelegate"},"Classes/DefaultPurchaseDelegate.html#/s:16InAppPurchaseLib07DefaultC8DelegateCACycfc":{"name":"init()","abstract":"
Undocumented
","parent_name":"DefaultPurchaseDelegate"},"Classes/DefaultPurchaseDelegate.html#/s:16InAppPurchaseLib07DefaultC8DelegateC16productPurchased0G10IdentifierySS_tF":{"name":"productPurchased(productIdentifier:)","abstract":"
Finish the product transactions when a product is newly purchased, updated or restored.
","parent_name":"DefaultPurchaseDelegate"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP11iapProductsSayAA10IAPProductVGvpZ":{"name":"iapProducts","abstract":"
The array of IAPProduct
.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP18validatorUrlStringSSSgvpZ":{"name":"validatorUrlString","abstract":"
The validator url retrieved from Fovea.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP03iapC8DelegateAA011IAPPurchaseF0_pSgvpZ":{"name":"iapPurchaseDelegate","abstract":"
The instance of class that adopts the IAPPurchaseDelegate
protocol.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP19applicationUsernameSSSgvpZ":{"name":"applicationUsername","abstract":"
The user name, if your app implements user login.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP10initialize11iapProducts18validatorUrlString0fC8Delegate19applicationUsernameySayAA10IAPProductVG_SSAA011IAPPurchaseK0_pSSSgtFZ":{"name":"initialize(iapProducts:validatorUrlString:iapPurchaseDelegate:applicationUsername:)","abstract":"
Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP4stopyyFZ":{"name":"stop()","abstract":"
Stop observing the payment queue, when the application will terminate, for proper cleanup.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP7refresh8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"refresh(callback:)","abstract":"
Refresh Product list and user Receipt.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP11getProductsSaySo9SKProductCGyFZ":{"name":"getProducts()","abstract":"
Gets all products retrieved from the App Store
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP12getProductBy10identifierSo9SKProductCSgSS_tFZ":{"name":"getProductBy(identifier:)","abstract":"
Gets the product by its identifier from the list of products retrieved from the App Store.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP15canMakePaymentsSbyFZ":{"name":"canMakePayments()","abstract":"
Checks if the user is allowed to authorize payments.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP8purchase17productIdentifier8quantity8callbackySS_SiyAA17IAPPurchaseResultVctFZ":{"name":"purchase(productIdentifier:quantity:callback:)","abstract":"
Request a Payment from the App Store.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP16restorePurchases8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"restorePurchases(callback:)","abstract":"
Restore purchased products.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP18finishTransactions3forySS_tFZ":{"name":"finishTransactions(for:)","abstract":"
Finish all transactions for the product.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP22hasDeferredTransaction3forSbSS_tFZ":{"name":"hasDeferredTransaction(for:)","abstract":"
Checks if the last transaction state for a given product was deferred.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP19hasAlreadyPurchasedSbyFZ":{"name":"hasAlreadyPurchased()","abstract":"
Checks if the user has already purchased at least one product.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP09hasActiveC03forSbSS_tFZ":{"name":"hasActivePurchase(for:)","abstract":"
Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP21hasActiveSubscriptionSbyFZ":{"name":"hasActiveSubscription()","abstract":"
Checks if the user has an active auto renewable subscription regardless of the product identifier.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP03getC4Date3for10Foundation0F0VSgSS_tFZ":{"name":"getPurchaseDate(for:)","abstract":"
Returns the latest purchased date for a given product.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP13getExpiryDate3for10Foundation0G0VSgSS_tFZ":{"name":"getExpiryDate(for:)","abstract":"
Returns the expiry date for a subcription. May be past or future.
","parent_name":"InAppPurchaseLib"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C11iapProductsSayAA10IAPProductVGvpZ":{"name":"iapProducts","abstract":"
The array of IAPProduct
.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C18validatorUrlStringSSSgvpZ":{"name":"validatorUrlString","abstract":"
The validator url retrieved from Fovea.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C03iapC8DelegateAA011IAPPurchaseF0_pSgvpZ":{"name":"iapPurchaseDelegate","abstract":"
The instance of class that adopts the IAPPurchaseDelegate
protocol.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C19applicationUsernameSSSgvpZ":{"name":"applicationUsername","abstract":"
The user name, if your app implements user login.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C10initialize11iapProducts18validatorUrlString0fC8Delegate19applicationUsernameySayAA10IAPProductVG_SSAA011IAPPurchaseK0_pSSSgtFZ":{"name":"initialize(iapProducts:validatorUrlString:iapPurchaseDelegate:applicationUsername:)","abstract":"
Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C4stopyyFZ":{"name":"stop()","abstract":"
Stop observing the payment queue, when the application will terminate, for proper cleanup.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C7refresh8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"refresh(callback:)","abstract":"
Refresh Product list and user Receipt.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C11getProductsSaySo9SKProductCGyFZ":{"name":"getProducts()","abstract":"
Gets all products retrieved from the App Store
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C12getProductBy10identifierSo9SKProductCSgSS_tFZ":{"name":"getProductBy(identifier:)","abstract":"
Gets the product by its identifier from the list of products retrieved from the App Store.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C15canMakePaymentsSbyFZ":{"name":"canMakePayments()","abstract":"
Checks if the user is allowed to authorize payments.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C8purchase17productIdentifier8quantity8callbackySS_SiyAA17IAPPurchaseResultVctFZ":{"name":"purchase(productIdentifier:quantity:callback:)","abstract":"
Request a Payment from the App Store.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C16restorePurchases8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"restorePurchases(callback:)","abstract":"
Restore purchased products.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C18finishTransactions3forySS_tFZ":{"name":"finishTransactions(for:)","abstract":"
Finish all transactions for the product.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C22hasDeferredTransaction3forSbSS_tFZ":{"name":"hasDeferredTransaction(for:)","abstract":"
Checks if the last transaction state for a given product was deferred.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C19hasAlreadyPurchasedSbyFZ":{"name":"hasAlreadyPurchased()","abstract":"
Checks if the user has already purchased at least one product.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C09hasActiveC03forSbSS_tFZ":{"name":"hasActivePurchase(for:)","abstract":"
Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C21hasActiveSubscriptionSbyFZ":{"name":"hasActiveSubscription()","abstract":"
Checks if the user has an active auto renewable subscription regardless of the product identifier.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C03getC4Date3for10Foundation0F0VSgSS_tFZ":{"name":"getPurchaseDate(for:)","abstract":"
Returns the latest purchased date for a given product.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C13getExpiryDate3for10Foundation0G0VSgSS_tFZ":{"name":"getExpiryDate(for:)","abstract":"
Returns the expiry date for a subcription. May be past or future.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html":{"name":"InAppPurchase"},"Protocols/InAppPurchaseLib.html":{"name":"InAppPurchaseLib","abstract":"
The protocol that InAppPurchase
adopts.
"},"Classes/DefaultPurchaseDelegate.html":{"name":"DefaultPurchaseDelegate","abstract":"
The default implementation of IAPPurchaseDelegate
if no other is provided. It is enough if you only have non-consumable and/or auto-renewable subscription products.
"},"Protocols/IAPPurchaseDelegate.html":{"name":"IAPPurchaseDelegate","abstract":"
The protocol that you must adopt if you have consumable and/or non-renewing subscription products.
"},"Structs/IAPProduct.html":{"name":"IAPProduct","abstract":"
Undocumented
"},"Enums/IAPProductType.html":{"name":"IAPProductType","abstract":"
Undocumented
"},"Extensions/SKProduct.html":{"name":"SKProduct"},"Enums/IAPPeriodFormat.html":{"name":"IAPPeriodFormat","abstract":"
Undocumented
"},"API%20documentation.html#/s:16InAppPurchaseLib19IAPPurchaseCallbacka":{"name":"IAPPurchaseCallback","abstract":"
Undocumented
"},"API%20documentation.html#/s:16InAppPurchaseLib18IAPRefreshCallbacka":{"name":"IAPRefreshCallback","abstract":"
Undocumented
"},"Structs/IAPPurchaseResult.html":{"name":"IAPPurchaseResult","abstract":"
The result returned in the purchase()
callback.
"},"Structs/IAPRefreshResult.html":{"name":"IAPRefreshResult","abstract":"
The result returned in the refresh()
or restorePurchases()
callback.
"},"Enums/IAPPurchaseResultState.html":{"name":"IAPPurchaseResultState","abstract":"
The list of the different states of the IAPPurchaseResult
.
"},"Enums/IAPRefreshResultState.html":{"name":"IAPRefreshResultState","abstract":"
The list of the different states of the IAPRefreshResult
.
"},"Structs/IAPError.html":{"name":"IAPError","abstract":"
When calling refresh()
, purchase()
or restorePurchases()
, the callback can return an IAPError
if the state is failed
.
"},"Enums/IAPErrorCode.html":{"name":"IAPErrorCode","abstract":"
The list of error codes that can be returned by the library.
"},"Protocols/IAPErrorProtocol.html":{"name":"IAPErrorProtocol","abstract":"
Undocumented
"},"initialization.html":{"name":"Initialization"},"displaying-products.html":{"name":"Displaying products"},"displaying-subscriptions.html":{"name":"Displaying subscriptions"},"refreshing.html":{"name":"Refreshing"},"purchasing.html":{"name":"Purchasing"},"handling-purchases.html":{"name":"Handling purchases"},"restoring-purchases.html":{"name":"Restoring purchases"},"displaying-products-with-purchases.html":{"name":"Displaying products with purchases"},"errors.html":{"name":"Errors"},"analytics.html":{"name":"Analytics"},"server-integration.html":{"name":"Server integration"},"installation.html":{"name":"Installation"},"micro-example.html":{"name":"Micro Example"},"Getting%20Started.html":{"name":"Getting Started"},"Usage.html":{"name":"Usage"},"API%20documentation.html":{"name":"API documentation"}}
\ No newline at end of file
+{"Protocols/IAPErrorProtocol.html#/s:16InAppPurchaseLib16IAPErrorProtocolP4codeAA0E4CodeOvp":{"name":"code","abstract":"
Undocumented
","parent_name":"IAPErrorProtocol"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21libraryNotInitializedyA2CmF":{"name":"libraryNotInitialized","abstract":"
You must call the initialize
fuction before using the library.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO23bundleIdentifierInvalidyA2CmF":{"name":"bundleIdentifierInvalid","abstract":"
The Bundle Identifier is invalid.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO19validatorUrlInvalidyA2CmF":{"name":"validatorUrlInvalid","abstract":"
The Validator URL String is invalid.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO20refreshReceiptFailedyA2CmF":{"name":"refreshReceiptFailed","abstract":"
Failed to refresh the App Store receipt.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21validateReceiptFailedyA2CmF":{"name":"validateReceiptFailed","abstract":"
Failed to validate the App Store receipt with Fovea.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17readReceiptFailedyA2CmF":{"name":"readReceiptFailed","abstract":"
Failed to read the receipt validation.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21refreshProductsFailedyA2CmF":{"name":"refreshProductsFailed","abstract":"
Failed to refresh products from the App Store.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO15productNotFoundyA2CmF":{"name":"productNotFound","abstract":"
The product was not found on the App Store and cannot be purchased.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO010cannotMakeC0yA2CmF":{"name":"cannotMakePurchase","abstract":"
The user is not allowed to authorize payments.
","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17alreadyPurchasingyA2CmF":{"name":"alreadyPurchasing","abstract":"
A purchase is already in progress.
","parent_name":"IAPErrorCode"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV4codeAA0E4CodeOvp":{"name":"code","abstract":"
The error code.
","parent_name":"IAPError"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV20localizedDescriptionSSvp":{"name":"localizedDescription","abstract":"
The error description.
","parent_name":"IAPError"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO9succeededyA2CmF":{"name":"succeeded","abstract":"
Refresh was successful.
","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO6failedyA2CmF":{"name":"failed","abstract":"
Refresh failed.
","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO7skippedyA2CmF":{"name":"skipped","abstract":"
Refresh has been skipped because it is not necessary.
","parent_name":"IAPRefreshResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9purchasedyA2CmF":{"name":"purchased","abstract":"
The purchase was successful.
","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO6failedyA2CmF":{"name":"failed","abstract":"
Puchase failed.
","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9cancelledyA2CmF":{"name":"cancelled","abstract":"
The purchase was cancelled by the user.
","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO8deferredyA2CmF":{"name":"deferred","abstract":"
The purchase is deferred.
","parent_name":"IAPPurchaseResultState"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV5stateAA0eF5StateOvp":{"name":"state","abstract":"
The result state.
","parent_name":"IAPRefreshResult"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV8iapErrorAA8IAPErrorVSgvp":{"name":"iapError","abstract":"
If the state is failed
, the result can return an IAPError
.","parent_name":"IAPRefreshResult"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV14addedPurchasesSivp":{"name":"addedPurchases","abstract":"
If the state is succeeded
, returns the number of purchases that have been added.
","parent_name":"IAPRefreshResult"},"Structs/IAPRefreshResult.html#/s:16InAppPurchaseLib16IAPRefreshResultV16updatedPurchasesSivp":{"name":"updatedPurchases","abstract":"
If the state is succeeded
, returns the number of purchases that have been updated.
","parent_name":"IAPRefreshResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV5stateAA0eF5StateOvp":{"name":"state","abstract":"
The result state.
","parent_name":"IAPPurchaseResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV8iapErrorAA8IAPErrorVSgvp":{"name":"iapError","abstract":"
If the state is failed
, the result can return an IAPError
.","parent_name":"IAPPurchaseResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV7skErrorSC11SKErrorCodeLeVSgvp":{"name":"skError","abstract":"
If the state is failed
, the result can return an SKError
.","parent_name":"IAPPurchaseResult"},"Structs/IAPPurchaseResult.html#/s:16InAppPurchaseLib17IAPPurchaseResultV20localizedDescriptionSSSgvp":{"name":"localizedDescription","abstract":"
If there is an error, return the localized description.
","parent_name":"IAPPurchaseResult"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO5shortyA2CmF":{"name":"short","abstract":"
Remove the number of units if it is equal to 1.","parent_name":"IAPPeriodFormat"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO4longyA2CmF":{"name":"long","abstract":"
The period will be returned with the number and the unit.","parent_name":"IAPPeriodFormat"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE21localizedPeriodFormatAC09IAPPeriodH0OvpZ":{"name":"localizedPeriodFormat","abstract":"
The format used for the localized subscription periods.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE28hasIntroductoryPriceEligibleSbyF":{"name":"hasIntroductoryPriceEligible()","abstract":"
Checks if the product has an introductory price the user is eligible to.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE14localizedPriceSSvp":{"name":"localizedPrice","abstract":"
Returns a localized string with the cost of the product in the local currency.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE27localizedSubscriptionPeriodSSSgvp":{"name":"localizedSubscriptionPeriod","abstract":"
Returns a localized string with the period of the subscription product.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE26localizedIntroductoryPriceSSSgvp":{"name":"localizedIntroductoryPrice","abstract":"
Returns a localized string with the introductory price if available, in the local currency.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE27localizedIntroductoryPeriodSSSgvp":{"name":"localizedIntroductoryPeriod","abstract":"
Returns a localized string with the introductory price period of the subscription product.
","parent_name":"SKProduct"},"Extensions/SKProduct.html#/s:So9SKProductC16InAppPurchaseLibE29localizedIntroductoryDurationSSSgvp":{"name":"localizedIntroductoryDuration","abstract":"
Returns a localized string with the duration of the introductory price.
","parent_name":"SKProduct"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO10consumableyA2CmF":{"name":"consumable","abstract":"
Consumable in-app purchases are used once, are depleted, and can be purchased again.
","parent_name":"IAPProductType"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO13nonConsumableyA2CmF":{"name":"nonConsumable","abstract":"
Non-consumables are purchased once and do not expire.
","parent_name":"IAPProductType"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO23nonRenewingSubscriptionyA2CmF":{"name":"nonRenewingSubscription","abstract":"
This type of subscription does not renew automatically, so users need to renew each time.
","parent_name":"IAPProductType"},"Enums/IAPProductType.html#/s:16InAppPurchaseLib14IAPProductTypeO25autoRenewableSubscriptionyA2CmF":{"name":"autoRenewableSubscription","abstract":"
Users are charged on a recurring basis until they decide to cancel.
","parent_name":"IAPProductType"},"Structs/IAPProduct.html#/s:16InAppPurchaseLib10IAPProductV17productIdentifierSSvp":{"name":"productIdentifier","abstract":"
The identifier of the product.
","parent_name":"IAPProduct"},"Structs/IAPProduct.html#/s:16InAppPurchaseLib10IAPProductV11productTypeAA0eG0Ovp":{"name":"productType","abstract":"
The type of the product.
","parent_name":"IAPProduct"},"Structs/IAPProduct.html#/s:16InAppPurchaseLib10IAPProductV17productIdentifier0F4TypeACSS_AA0eH0Otcfc":{"name":"init(productIdentifier:productType:)","abstract":"
Initializes an IAPProduct
with its identifier and type.
","parent_name":"IAPProduct"},"Protocols/IAPPurchaseDelegate.html#/s:16InAppPurchaseLib19IAPPurchaseDelegateP16productPurchased0G10IdentifierySS_tF":{"name":"productPurchased(productIdentifier:)","abstract":"
Called when a product is newly purchased, updated or restored.
","parent_name":"IAPPurchaseDelegate"},"Classes/DefaultPurchaseDelegate.html#/s:16InAppPurchaseLib07DefaultC8DelegateCACycfc":{"name":"init()","abstract":"
Undocumented
","parent_name":"DefaultPurchaseDelegate"},"Classes/DefaultPurchaseDelegate.html#/s:16InAppPurchaseLib07DefaultC8DelegateC16productPurchased0G10IdentifierySS_tF":{"name":"productPurchased(productIdentifier:)","abstract":"
Finish the product transactions when a product is newly purchased, updated or restored.
","parent_name":"DefaultPurchaseDelegate"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP11iapProductsSayAA10IAPProductVGvpZ":{"name":"iapProducts","abstract":"
The array of IAPProduct
.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP18validatorUrlStringSSSgvpZ":{"name":"validatorUrlString","abstract":"
The validator url retrieved from Fovea.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP03iapC8DelegateAA011IAPPurchaseF0_pSgvpZ":{"name":"iapPurchaseDelegate","abstract":"
The instance of class that adopts the IAPPurchaseDelegate
protocol.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP19applicationUsernameSSSgvpZ":{"name":"applicationUsername","abstract":"
The user name, if your app implements user login.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP10initialize11iapProducts18validatorUrlString0fC8Delegate19applicationUsernameySayAA10IAPProductVG_SSAA011IAPPurchaseK0_pSSSgtFZ":{"name":"initialize(iapProducts:validatorUrlString:iapPurchaseDelegate:applicationUsername:)","abstract":"
Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP4stopyyFZ":{"name":"stop()","abstract":"
Stop observing the payment queue, when the application will terminate, for proper cleanup.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP7refresh8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"refresh(callback:)","abstract":"
Refresh Product list and user Receipt.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP11getProductsSaySo9SKProductCGyFZ":{"name":"getProducts()","abstract":"
Gets all products retrieved from the App Store
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP12getProductBy10identifierSo9SKProductCSgSS_tFZ":{"name":"getProductBy(identifier:)","abstract":"
Gets the product by its identifier from the list of products retrieved from the App Store.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP15canMakePaymentsSbyFZ":{"name":"canMakePayments()","abstract":"
Checks if the user is allowed to authorize payments.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP8purchase17productIdentifier8quantity8callbackySS_SiyAA17IAPPurchaseResultVctFZ":{"name":"purchase(productIdentifier:quantity:callback:)","abstract":"
Request a Payment from the App Store.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP16restorePurchases8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"restorePurchases(callback:)","abstract":"
Restore purchased products.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP18finishTransactions3forySS_tFZ":{"name":"finishTransactions(for:)","abstract":"
Finish all transactions for the product.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP22hasDeferredTransaction3forSbSS_tFZ":{"name":"hasDeferredTransaction(for:)","abstract":"
Checks if the last transaction state for a given product was deferred.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP19hasAlreadyPurchasedSbyFZ":{"name":"hasAlreadyPurchased()","abstract":"
Checks if the user has already purchased at least one product.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP09hasActiveC03forSbSS_tFZ":{"name":"hasActivePurchase(for:)","abstract":"
Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP21hasActiveSubscriptionSbyFZ":{"name":"hasActiveSubscription()","abstract":"
Checks if the user has an active auto renewable subscription regardless of the product identifier.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP03getC4Date3for10Foundation0F0VSgSS_tFZ":{"name":"getPurchaseDate(for:)","abstract":"
Returns the latest purchased date for a given product.
","parent_name":"InAppPurchaseLib"},"Protocols/InAppPurchaseLib.html#/s:16InAppPurchaseLibAAP13getExpiryDate3for10Foundation0G0VSgSS_tFZ":{"name":"getExpiryDate(for:)","abstract":"
Returns the expiry date for a subcription. May be past or future.
","parent_name":"InAppPurchaseLib"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C11iapProductsSayAA10IAPProductVGvpZ":{"name":"iapProducts","abstract":"
The array of IAPProduct
.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C18validatorUrlStringSSSgvpZ":{"name":"validatorUrlString","abstract":"
The validator url retrieved from Fovea.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C03iapC8DelegateAA011IAPPurchaseF0_pSgvpZ":{"name":"iapPurchaseDelegate","abstract":"
The instance of class that adopts the IAPPurchaseDelegate
protocol.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C19applicationUsernameSSSgvpZ":{"name":"applicationUsername","abstract":"
The user name, if your app implements user login.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C10initialize11iapProducts18validatorUrlString0fC8Delegate19applicationUsernameySayAA10IAPProductVG_SSAA011IAPPurchaseK0_pSSSgtFZ":{"name":"initialize(iapProducts:validatorUrlString:iapPurchaseDelegate:applicationUsername:)","abstract":"
Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C4stopyyFZ":{"name":"stop()","abstract":"
Stop observing the payment queue, when the application will terminate, for proper cleanup.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C7refresh8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"refresh(callback:)","abstract":"
Refresh Product list and user Receipt.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C11getProductsSaySo9SKProductCGyFZ":{"name":"getProducts()","abstract":"
Gets all products retrieved from the App Store
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C12getProductBy10identifierSo9SKProductCSgSS_tFZ":{"name":"getProductBy(identifier:)","abstract":"
Gets the product by its identifier from the list of products retrieved from the App Store.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C15canMakePaymentsSbyFZ":{"name":"canMakePayments()","abstract":"
Checks if the user is allowed to authorize payments.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C8purchase17productIdentifier8quantity8callbackySS_SiyAA17IAPPurchaseResultVctFZ":{"name":"purchase(productIdentifier:quantity:callback:)","abstract":"
Request a Payment from the App Store.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C16restorePurchases8callbackyyAA16IAPRefreshResultVc_tFZ":{"name":"restorePurchases(callback:)","abstract":"
Restore purchased products.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C18finishTransactions3forySS_tFZ":{"name":"finishTransactions(for:)","abstract":"
Finish all transactions for the product.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C22hasDeferredTransaction3forSbSS_tFZ":{"name":"hasDeferredTransaction(for:)","abstract":"
Checks if the last transaction state for a given product was deferred.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C19hasAlreadyPurchasedSbyFZ":{"name":"hasAlreadyPurchased()","abstract":"
Checks if the user has already purchased at least one product.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C09hasActiveC03forSbSS_tFZ":{"name":"hasActivePurchase(for:)","abstract":"
Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C21hasActiveSubscriptionSbyFZ":{"name":"hasActiveSubscription()","abstract":"
Checks if the user has an active auto renewable subscription regardless of the product identifier.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C03getC4Date3for10Foundation0F0VSgSS_tFZ":{"name":"getPurchaseDate(for:)","abstract":"
Returns the latest purchased date for a given product.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html#/s:16InAppPurchaseLib0abC0C13getExpiryDate3for10Foundation0G0VSgSS_tFZ":{"name":"getExpiryDate(for:)","abstract":"
Returns the expiry date for a subcription. May be past or future.
","parent_name":"InAppPurchase"},"Classes/InAppPurchase.html":{"name":"InAppPurchase","abstract":"
The main class of the library.
"},"Protocols/InAppPurchaseLib.html":{"name":"InAppPurchaseLib","abstract":"
The protocol that InAppPurchase
adopts.
"},"Classes/DefaultPurchaseDelegate.html":{"name":"DefaultPurchaseDelegate","abstract":"
The default implementation of IAPPurchaseDelegate
if no other is provided. It is enough if you only have non-consumable and/or auto-renewable subscription products.
"},"Protocols/IAPPurchaseDelegate.html":{"name":"IAPPurchaseDelegate","abstract":"
The protocol that you must adopt if you have consumable and/or non-renewing subscription products.
"},"Structs/IAPProduct.html":{"name":"IAPProduct","abstract":"
Basic product information used by InAppPurchase
.
"},"Enums/IAPProductType.html":{"name":"IAPProductType","abstract":"
Types of in-app purchases.
"},"Extensions/SKProduct.html":{"name":"SKProduct"},"Enums/IAPPeriodFormat.html":{"name":"IAPPeriodFormat","abstract":"
The format used for the localized subscription periods.
"},"API%20documentation.html#/s:16InAppPurchaseLib19IAPPurchaseCallbacka":{"name":"IAPPurchaseCallback","abstract":"
Undocumented
"},"API%20documentation.html#/s:16InAppPurchaseLib18IAPRefreshCallbacka":{"name":"IAPRefreshCallback","abstract":"
Undocumented
"},"Structs/IAPPurchaseResult.html":{"name":"IAPPurchaseResult","abstract":"
The result returned in the purchase()
callback.
"},"Structs/IAPRefreshResult.html":{"name":"IAPRefreshResult","abstract":"
The result returned in the refresh()
or restorePurchases()
callback.
"},"Enums/IAPPurchaseResultState.html":{"name":"IAPPurchaseResultState","abstract":"
The list of the different states of the IAPPurchaseResult
.
"},"Enums/IAPRefreshResultState.html":{"name":"IAPRefreshResultState","abstract":"
The list of the different states of the IAPRefreshResult
.
"},"Structs/IAPError.html":{"name":"IAPError","abstract":"
When calling refresh()
, purchase()
or restorePurchases()
, the callback can return an IAPError
if the state is failed
.
"},"Enums/IAPErrorCode.html":{"name":"IAPErrorCode","abstract":"
The list of error codes that can be returned by the library.
"},"Protocols/IAPErrorProtocol.html":{"name":"IAPErrorProtocol","abstract":"
Undocumented
"},"initialization.html":{"name":"Initialization"},"displaying-products.html":{"name":"Displaying products"},"displaying-subscriptions.html":{"name":"Displaying subscriptions"},"refreshing.html":{"name":"Refreshing"},"purchasing.html":{"name":"Purchasing"},"handling-purchases.html":{"name":"Handling purchases"},"restoring-purchases.html":{"name":"Restoring purchases"},"displaying-products-with-purchases.html":{"name":"Displaying products with purchases"},"errors.html":{"name":"Errors"},"analytics.html":{"name":"Analytics"},"server-integration.html":{"name":"Server integration"},"installation.html":{"name":"Installation"},"micro-example.html":{"name":"Micro Example"},"Getting%20Started.html":{"name":"Getting Started"},"Usage.html":{"name":"Usage"},"API%20documentation.html":{"name":"API documentation"}}
\ No newline at end of file
diff --git a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/server-integration.html b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/server-integration.html
index ab51e7d..3a3900d 100644
--- a/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/server-integration.html
+++ b/docs/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/server-integration.html
@@ -22,7 +22,7 @@
- (77% documented)
+ (95% documented)
Features
Getting Started
If you haven’t already, I highly recommend your read the Overview and Preparing section of Apple’s In-App Purchase official documentation.
+
Requirements
+
+
+- Configure your App and Xcode to support In-App Purchases.
+
+
+- Create and configure your Fovea.Billing project account:
+
+
+- Set your bundle ID
+- The iOS Shared Secret (or shared key) is to be retrieved from AppStoreConnect
+- The iOS Subscription Status URL (only if you want subscriptions)
+
+
Installation
@@ -190,97 +206,58 @@ Installation
- Go to the section Swift Package
- Click on (+) Add Package Dependency
- Copy the Git URL: https://github.com/iridescent-dev/iap-swift-lib.git
-- Click on Next > Next
+- Click on Next
+- In Rules select Version: Up to Next Major …
+- Click on Next
- Make sure your project is selected in Add to target
- Click on Finish
Note: You have to import InAppPurchaseLib
wherever you use the library.
-
Micro Example
-
/** AppDelegate.swift */
-import UIKit
-import InAppPurchaseLib
-
-@UIApplicationMain
-class AppDelegate: UIResponder, UIApplicationDelegate {
- func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
- // Initialize the library
- InAppPurchase.initialize(
- iapProducts: [
- IAPProduct(productIdentifier: "my_product", productType: .nonConsumable)
- ],
- validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678"
- )
- return true
- }
+Basic Usage
- func applicationWillTerminate(_ application: UIApplication) {
- // clean
- InAppPurchase.stop()
- }
+
+Initialize the library
+InAppPurchase.initialize(
+iapProducts: [ IAPProduct(productIdentifier: "my_product", productType: .nonConsumable) ],
+validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678"
+)
+
+Stop library when the application will terminate
+func applicationWillTerminate(_ application: UIApplication) {
+InAppPurchase.stop()
}
-
-/** ViewController.swift */
-import UIKit
-import StoreKit
-import InAppPurchaseLib
-
-class ViewController: UIViewController {
- private var loaderView = LoaderView()
- @IBOutlet weak var statusLabel: UILabel!
- @IBOutlet weak var productTitleLabel: UILabel!
- @IBOutlet weak var productDescriptionLabel: UILabel!
- @IBOutlet weak var purchaseButton: UIButton!
- @IBOutlet weak var restorePurchasesButton: UIButton!
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Add action for purchases and restore butons.
- purchaseButton.addTarget(self, action: #selector(self.purchase), for: .touchUpInside)
- restorePurchasesButton.addTarget(self, action: #selector(self.restorePurchases), for: .touchUpInside)
- }
-
- override func viewWillAppear(_ animated: Bool) {
- self.refreshView()
- InAppPurchase.refresh(callback: { _ in
- self.refreshView()
- })
- }
-
- func refreshView() {
- guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product") else {
- self.productTitleLabel.text = "Product unavailable"
- return
- }
- // Display product information.
- productTitleLabel.text = product.localizedTitle
- productDescriptionLabel.text = product.localizedDescription
- purchaseButton.setTitle(product.localizedPrice, for: .normal)
-
- // Disable the button if the product has already been purchased.
- if InAppPurchase.hasActivePurchase(for: "my_product") {
- statusLabel.text = "OWNED"
- purchaseButton.isPointerInteractionEnabled = false
- }
- }
-
- @IBAction func purchase(_ sender: Any) {
- self.loaderView.show()
- InAppPurchase.purchase(
- productIdentifier: "my_product",
- callback: { result in
- self.loaderView.hide()
- })
- }
-
- @IBAction func restorePurchases(_ sender: Any) {
- self.loaderView.show()
- InAppPurchase.restorePurchases(callback: { result in
- self.loaderView.hide()
- })
- }
+
+Display product information
+guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product") else { return }
+productTitleLabel.text = product.localizedTitle
+productDescriptionLabel.text = product.localizedDescription
+productPriceLabel.text = product.localizedPrice
+
+Initialize a purchase
+@IBAction func purchase(_ sender: Any) {
+self.loaderView.show()
+InAppPurchase.purchase(
+productIdentifier: "my_product",
+callback: { result in
+ self.loaderView.hide()
+})
}
-
+
+
Unlock purchased content
+if InAppPurchase.hasActivePurchase(for: "my_product") {
+// display content related to the product
+}
+
+
Restore purchases
+@IBAction func restorePurchases(_ sender: Any) {
+self.loaderView.show()
+InAppPurchase.restorePurchases(callback: { result in
+self.loaderView.hide()
+})
+}
+
+
Documentation