diff --git a/Sources/InAppPurchaseLib/InAppPurchase.swift b/Sources/InAppPurchaseLib/InAppPurchase.swift index 3d382de..5eb946f 100644 --- a/Sources/InAppPurchaseLib/InAppPurchase.swift +++ b/Sources/InAppPurchaseLib/InAppPurchase.swift @@ -10,28 +10,37 @@ import StoreKit public class InAppPurchase: NSObject, InAppPurchaseLib { - /// InAppPurchaseLib version number. + // InAppPurchaseLib version number. internal static let versionNumber = "1.0.2" - /// The initialize function has been called. + // The initialize function has been called. internal static var initialized: Bool { return !iapProducts.isEmpty && iapPurchaseDelegate != nil && validatorUrlString != nil } - /// Callbacks that are waiting for the refresh. + // Callbacks that are waiting for the refresh. private static var refreshCallbacks: Array = [] - /// The date of the last refresh. + // The date of the last refresh. private static var lastRefreshDate: Date? = nil /* MARK: - Properties */ + /// The array of `IAPProduct`. public static var iapProducts: Array = [] - public static var iapPurchaseDelegate: IAPPurchaseDelegate? = nil + /// The validator url retrieved from Fovea. public static var validatorUrlString: String? = nil + /// The instance of class that adopts the `IAPPurchaseDelegate` protocol. + public static var iapPurchaseDelegate: IAPPurchaseDelegate? = nil + /// The user name, if your app implements user login. public static var applicationUsername: String? = nil /* MARK: - Main methods */ - // Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt. - public static func initialize(iapProducts: Array, iapPurchaseDelegate: IAPPurchaseDelegate, validatorUrlString: String, applicationUsername: String?) { + /// Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt. + /// - Parameters: + /// - iapProducts: An array of `IAPProduct`. + /// - validatorUrlString: The validator url retrieved from Fovea. + /// - iapPurchaseDelegate: An instance of class that adopts the `IAPPurchaseDelegate` protocol (default value = `DefaultPurchaseDelegate`). + /// - applicationUsername: The user name, if your app implements user login. + public static func initialize(iapProducts: Array, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?) { InAppPurchase.iapProducts = iapProducts InAppPurchase.iapPurchaseDelegate = iapPurchaseDelegate @@ -42,12 +51,14 @@ public class InAppPurchase: NSObject, InAppPurchaseLib { IAPTransactionObserver.shared.start() } - // Stop observing the payment queue, when the application will terminate, for proper cleanup. + /// Stop observing the payment queue, when the application will terminate, for proper cleanup. public static func stop() { IAPTransactionObserver.shared.stop() } - // Refresh Product list and user Receipt. + /// Refresh Product list and user Receipt. + /// - Parameter callback: The function that will be called after processing. + /// - See also:`IAPRefreshCallback` and `IAPRefreshResult`. public static func refresh(callback: @escaping IAPRefreshCallback) { if !initialized { callback(IAPRefreshResult(state: .failed, iapError: IAPError(code: .libraryNotInitialized))) @@ -111,19 +122,35 @@ public class InAppPurchase: NSObject, InAppPurchaseLib { /* MARK: - Products information */ - // Returns all products retrieved from the App Store. + /// Gets all products retrieved from the App Store + /// - Returns: An array of products. + /// - See also: `SKProduct`. public static func getProducts() -> Array { return IAPProductService.shared.getProducts() } - // Gets the product by its identifier from the list of products retrieved from the App Store. + /// Gets the product by its identifier from the list of products retrieved from the App Store. + /// - Parameter identifier: The identifier of the product. + /// - Returns: The product if it was retrieved from the App Store. + /// - See also: `SKProduct`. public static func getProductBy(identifier: String) -> SKProduct? { return IAPProductService.shared.getProductBy(identifier: identifier) } /* MARK: - Purchasing and Restoring */ - // Request a Payment from the App Store. + /// Checks if the user is allowed to authorize payments. + /// - Returns: A boolean indicates if the user is allowed. + public static func canMakePayments() -> Bool { + return IAPTransactionObserver.shared.canMakePayments() + } + + /// Request a Payment from the App Store. + /// - Parameters: + /// - productIdentifier: The identifier of the product to purchase. + /// - quantity: The quantity to purchase (default value = 1). + /// - callback: The function that will be called after processing. + /// - See also:`IAPPurchaseCallback` and `IAPPurchaseResult`. public static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback) { if !initialized { callback(IAPPurchaseResult(state: .failed, iapError: IAPError(code: .libraryNotInitialized))) @@ -137,7 +164,9 @@ public class InAppPurchase: NSObject, InAppPurchaseLib { IAPTransactionObserver.shared.purchase(product: product, quantity: quantity, applicationUsername: applicationUsername, callback: callback) } - // Restore purchased products. + /// Restore purchased products. + /// - Parameter callback: The function that will be called after processing. + /// - See also:`IAPRefreshCallback` and `IAPRefreshResult`. public static func restorePurchases(callback: @escaping IAPRefreshCallback) { if !initialized { callback(IAPRefreshResult(state: .failed, iapError: IAPError(code: .libraryNotInitialized))) @@ -147,34 +176,36 @@ public class InAppPurchase: NSObject, InAppPurchaseLib { IAPReceiptService.shared.refresh(callback: callback) } - // Checks if the user is allowed to authorize payments. - public static func canMakePayments() -> Bool { - return IAPTransactionObserver.shared.canMakePayments() - } - - // Finish all transactions for the product. + /// Finish all transactions for the product. + /// - Parameter productIdentifier: The identifier of the product. public static func finishTransactions(for productIdentifier: String) { IAPTransactionObserver.shared.finishTransactions(for: productIdentifier) } - // Checks if the last transaction state for a given product was deferred. + /// Checks if the last transaction state for a given product was deferred. + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: A boolean indicates if the last transaction state was deferred. public static func hasDeferredTransaction(for productIdentifier: String) -> Bool { return IAPTransactionObserver.shared.hasDeferredTransaction(for: productIdentifier) } /* MARK: - Purchases information */ - // Checks if the user has already purchased at least one product. + /// Checks if the user has already purchased at least one product. + /// - Returns: A boolean indicates if the . public static func hasAlreadyPurchased() -> Bool { return IAPReceiptService.shared.hasAlreadyPurchased() } - // Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription). + /// Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription). + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: A boolean indicates if the user currently own (or is subscribed to) a given product. public static func hasActivePurchase(for productIdentifier: String) -> Bool { return IAPReceiptService.shared.hasActivePurchase(for: productIdentifier) } - // Checks if the user has an active auto renewable subscription. + /// Checks if the user has an active auto renewable subscription regardless of the product identifier. + /// - Returns: A boolean indicates if the user has an active auto renewable subscription. public static func hasActiveSubscription() -> Bool { for productIdentifier in (InAppPurchase.iapProducts.filter{ $0.productType == IAPProductType.autoRenewableSubscription }.map{ $0.productIdentifier }) { if IAPReceiptService.shared.hasActivePurchase(for: productIdentifier){ @@ -184,12 +215,16 @@ public class InAppPurchase: NSObject, InAppPurchaseLib { return false; } - // Returns the latest purchased date for a given product. + /// Returns the latest purchased date for a given product. + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: The latest purchase `Date` if set or `nil`. public static func getPurchaseDate(for productIdentifier: String) -> Date? { return IAPReceiptService.shared.getPurchaseDate(for: productIdentifier) } - // Returns the expiry date for a subcription. May be past or future. + /// Returns the expiry date for a subcription. May be past or future. + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: The expiry `Date` is set or `nil`. public static func getExpiryDate(for productIdentifier: String) -> Date? { return IAPReceiptService.shared.getExpiryDate(for: productIdentifier) } diff --git a/Sources/InAppPurchaseLib/InAppPurchaseLib.swift b/Sources/InAppPurchaseLib/InAppPurchaseLib.swift index ee8d09f..8e746ab 100644 --- a/Sources/InAppPurchaseLib/InAppPurchaseLib.swift +++ b/Sources/InAppPurchaseLib/InAppPurchaseLib.swift @@ -9,69 +9,104 @@ import Foundation import StoreKit -/* MARK: - The protocol that InAppPurchase adopts. */ +/// The protocol that `InAppPurchase`` adopts. public protocol InAppPurchaseLib { + /// The array of `IAPProduct`. static var iapProducts: Array { get } - static var iapPurchaseDelegate: IAPPurchaseDelegate? { get } + /// The validator url retrieved from Fovea. static var validatorUrlString: String? { get } + /// The instance of class that adopts the `IAPPurchaseDelegate` protocol. + static var iapPurchaseDelegate: IAPPurchaseDelegate? { get } + /// The user name, if your app implements user login. static var applicationUsername: String? { get set } - // Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt. - static func initialize(iapProducts: Array, iapPurchaseDelegate: IAPPurchaseDelegate, validatorUrlString: String, applicationUsername: String?) + /// Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt. + /// - Parameters: + /// - iapProducts: An array of `IAPProduct`. + /// - validatorUrlString: The validator url retrieved from Fovea. + /// - iapPurchaseDelegate: An instance of class that adopts the `IAPPurchaseDelegate` protocol (default value = `DefaultPurchaseDelegate`). + /// - applicationUsername: The user name, if your app implements user login. + static func initialize(iapProducts: Array, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?) -> Void - // Stop observing the payment queue, when the application will terminate, for proper cleanup. - static func stop() + /// Stop observing the payment queue, when the application will terminate, for proper cleanup. + static func stop() -> Void - // Refresh Product list and user Receipt. - static func refresh(callback: @escaping IAPRefreshCallback) + /// Refresh Product list and user Receipt. + /// - Parameter callback: The function that will be called after processing. + /// - See also:`IAPRefreshCallback` and `IAPRefreshResult`. + static func refresh(callback: @escaping IAPRefreshCallback) -> Void /* MARK: - Products information */ - // Returns all products retrieved from the App Store. + /// Gets all products retrieved from the App Store + /// - Returns: An array of products. + /// - See also: `SKProduct`. static func getProducts() -> Array - // Gets the product by its identifier from the list of products retrieved from the App Store. + /// Gets the product by its identifier from the list of products retrieved from the App Store. + /// - Parameter identifier: The identifier of the product. + /// - Returns: The product if it was retrieved from the App Store. + /// - See also: `SKProduct`. static func getProductBy(identifier: String) -> SKProduct? /* MARK: - Purchasing and Restoring */ - // Checks if the user is allowed to authorize payments. + /// Checks if the user is allowed to authorize payments. + /// - Returns: A boolean indicates if the user is allowed. static func canMakePayments() -> Bool - // Request a Payment from the App Store. - static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback) - - // Restore purchased products. - static func restorePurchases(callback: @escaping IAPRefreshCallback) - - // Finish all transactions for the product. - static func finishTransactions(for productIdentifier: String) - - // Checks if the last transaction state for a given product was deferred. + /// Request a Payment from the App Store. + /// - Parameters: + /// - productIdentifier: The identifier of the product to purchase. + /// - quantity: The quantity to purchase (default value = 1). + /// - callback: The function that will be called after processing. + /// - See also:`IAPPurchaseCallback` and `IAPPurchaseResult`. + static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback) -> Void + + /// Restore purchased products. + /// - Parameter callback: The function that will be called after processing. + /// - See also:`IAPRefreshCallback` and `IAPRefreshResult`. + static func restorePurchases(callback: @escaping IAPRefreshCallback) -> Void + + /// Finish all transactions for the product. + /// - Parameter productIdentifier: The identifier of the product. + static func finishTransactions(for productIdentifier: String) -> Void + + /// Checks if the last transaction state for a given product was deferred. + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: A boolean indicates if the last transaction state was deferred. static func hasDeferredTransaction(for productIdentifier: String) -> Bool /* MARK: - Purchases information */ - // Checks if the user has already purchased at least one product. + /// Checks if the user has already purchased at least one product. + /// - Returns: A boolean indicates if the . static func hasAlreadyPurchased() -> Bool - // Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription). + /// Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription). + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: A boolean indicates if the user currently own (or is subscribed to) a given product. static func hasActivePurchase(for productIdentifier: String) -> Bool - // Checks if the user has an active auto renewable subscription. + /// Checks if the user has an active auto renewable subscription regardless of the product identifier. + /// - Returns: A boolean indicates if the user has an active auto renewable subscription. static func hasActiveSubscription() -> Bool - // Returns the latest purchased date for a given product. + /// Returns the latest purchased date for a given product. + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: The latest purchase `Date` if set or `nil`. static func getPurchaseDate(for productIdentifier: String) -> Date? - // Returns the expiry date for a subcription. May be past or future. + /// Returns the expiry date for a subcription. May be past or future. + /// - Parameter productIdentifier: The identifier of the product. + /// - Returns: The expiry `Date` is set or `nil`. static func getExpiryDate(for productIdentifier: String) -> Date? } public extension InAppPurchaseLib { - // Sets default IAPPurchaseDelegate - static func initialize(iapProducts: Array, iapPurchaseDelegate: IAPPurchaseDelegate = DefaultPurchaseDelegate(), validatorUrlString: String, applicationUsername: String? = nil) { - return initialize(iapProducts: iapProducts, iapPurchaseDelegate: iapPurchaseDelegate, validatorUrlString: validatorUrlString, applicationUsername: applicationUsername) + // Sets default `iapPurchaseDelegate` and `applicationUsername` + static func initialize(iapProducts: Array, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate = DefaultPurchaseDelegate(), applicationUsername: String? = nil) { + return initialize(iapProducts: iapProducts, validatorUrlString: validatorUrlString, iapPurchaseDelegate: iapPurchaseDelegate, applicationUsername: applicationUsername) } // Sets 1 as default value for the quantity. @@ -82,17 +117,23 @@ public extension InAppPurchaseLib { /* MARK: - The protocol that you must adopt. */ +/// The protocol that you must adopt if you have `consumable` and/or `nonRenewingSubscription` products. public protocol IAPPurchaseDelegate { - // Called when a product is newly purchased, updated or restored. - func productPurchased(productIdentifier: String) + /// Called when a product is newly purchased, updated or restored. + /// - Parameter productIdentifier: The identifier of the product. + /// + /// - Important: You have to acknowledge delivery of the (virtual) item to finalize the transaction. Then you have to call `InAppPurchase.finishTransactions(for: productIdentifier)`as soon as you have delivered the product. + func productPurchased(productIdentifier: String) -> Void } -// The default implementation of IAPPurchaseDelegate if no other is provided. +/// The default implementation of `IAPPurchaseDelegate` if no other is provided. public class DefaultPurchaseDelegate: IAPPurchaseDelegate { public init(){} + + /// Finish the product transactions when a product is newly purchased, updated or restored. + /// - Parameter productIdentifier: The identifier of the product. public func productPurchased(productIdentifier: String) { - // Finish the product transactions. InAppPurchase.finishTransactions(for: productIdentifier) } } diff --git a/Sources/InAppPurchaseLib/Product/IAPProduct.swift b/Sources/InAppPurchaseLib/Product/IAPProduct.swift index 1bb9950..74e919e 100644 --- a/Sources/InAppPurchaseLib/Product/IAPProduct.swift +++ b/Sources/InAppPurchaseLib/Product/IAPProduct.swift @@ -9,9 +9,19 @@ import Foundation public struct IAPProduct { + + /// The identifier of the product. public var productIdentifier: String + + /// The type of the product. + /// - See also: `IAPProductType`. public var productType: IAPProductType + /// Initializes an `IAPProduct` with its identifier and type. + /// - Parameters: + /// - productIdentifier: The identifier of the product. + /// - productType: The type of the product. + /// - See also: `IAPProductType`. public init(productIdentifier: String, productType: IAPProductType) { self.productIdentifier = productIdentifier self.productType = productType diff --git a/Sources/InAppPurchaseLib/Product/SKProductExtension.swift b/Sources/InAppPurchaseLib/Product/SKProductExtension.swift index aeda2a5..d8c61d2 100644 --- a/Sources/InAppPurchaseLib/Product/SKProductExtension.swift +++ b/Sources/InAppPurchaseLib/Product/SKProductExtension.swift @@ -19,37 +19,37 @@ public enum IAPPeriodFormat { extension SKProduct { public static var localizedPeriodFormat: IAPPeriodFormat = .short - // Checks if the product has an introductory price the user is eligible to. + /// Checks if the product has an introductory price the user is eligible to. public func hasIntroductoryPriceEligible() -> Bool { let ineligibleForIntroPriceProductIDs = IAPStorageService.getStringArray(forKey: INELIGIBLE_FOR_INTRO_PRICE_PRODUCT_IDS_KEY) return !ineligibleForIntroPriceProductIDs.contains(productIdentifier) && introductoryPrice != nil } - // Returns a localized string with the cost of the product in the local currency. + /// Returns a localized string with the cost of the product in the local currency. public var localizedPrice: String { return getLocalizedPrice(locale: priceLocale, price: price) } - // Returns a localized string with the period of the subscription product. + /// Returns a localized string with the period of the subscription product. public var localizedSubscriptionPeriod: String? { if subscriptionPeriod == nil { return nil } return getLocalizedPeriod(unit: subscriptionPeriod!.unit, numberOfUnits: subscriptionPeriod!.numberOfUnits) } - // Returns a localized string with the introductory price if available, in the local currency. + /// Returns a localized string with the introductory price if available, in the local currency. public var localizedIntroductoryPrice: String? { if introductoryPrice == nil { return nil } return getLocalizedPrice(locale: introductoryPrice!.priceLocale, price: introductoryPrice!.price) } - // Returns a localized string with the introductory price period of the subscription product. + /// Returns a localized string with the introductory price period of the subscription product. public var localizedIntroductoryPeriod: String? { if introductoryPrice == nil { return nil } return getLocalizedPeriod(unit: introductoryPrice!.subscriptionPeriod.unit, numberOfUnits: introductoryPrice!.subscriptionPeriod.numberOfUnits) } - // Returns a localized string with the duration of the introductory price. + /// Returns a localized string with the duration of the introductory price. public var localizedIntroductoryDuration: String? { if introductoryPrice == nil { return nil } let numberOfUnits = introductoryPrice!.subscriptionPeriod.numberOfUnits * introductoryPrice!.numberOfPeriods diff --git a/_config.yml b/_config.yml deleted file mode 100644 index c419263..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index c419263..0000000 --- a/docs/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-cayman \ No newline at end of file diff --git a/docs/jazzy/Classes.html b/docs/jazzy/Classes.html new file mode 100644 index 0000000..d33eafb --- /dev/null +++ b/docs/jazzy/Classes.html @@ -0,0 +1,205 @@ + + + + Classes Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Classes

+

The following classes are available globally.

+ +
+
+
+ +
+
+
+ + +
+ +

The protocol that you must adopt.

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Classes/DefaultPurchaseDelegate.html b/docs/jazzy/Classes/DefaultPurchaseDelegate.html new file mode 100644 index 0000000..3a8424b --- /dev/null +++ b/docs/jazzy/Classes/DefaultPurchaseDelegate.html @@ -0,0 +1,215 @@ + + + + DefaultPurchaseDelegate Class Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

DefaultPurchaseDelegate

+
+
+
public class DefaultPurchaseDelegate : IAPPurchaseDelegate
+ +
+
+

The default implementation of IAPPurchaseDelegate if no other is provided.

+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Finish the product transactions when a product is newly purchased, updated or restored.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func productPurchased(productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Classes/InAppPurchase.html b/docs/jazzy/Classes/InAppPurchase.html new file mode 100644 index 0000000..b43f50e --- /dev/null +++ b/docs/jazzy/Classes/InAppPurchase.html @@ -0,0 +1,1027 @@ + + + + InAppPurchase Class Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

InAppPurchase

+
+
+
public class InAppPurchase : NSObject, InAppPurchaseLib
+ +
+
+

Undocumented

+ +
+
+
+
+ + +
+ +

Properties

+

+
+
+
    +
  • +
    + + + + iapProducts + +
    +
    +
    +
    +
    +
    +

    The array of IAPProduct.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var iapProducts: Array<IAPProduct>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validatorUrlString + +
    +
    +
    +
    +
    +
    +

    The validator url retrieved from Fovea.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var validatorUrlString: String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapPurchaseDelegate + +
    +
    +
    +
    +
    +
    +

    The instance of class that adopts the IAPPurchaseDelegate protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var iapPurchaseDelegate: IAPPurchaseDelegate?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + applicationUsername + +
    +
    +
    +
    +
    +
    +

    The user name, if your app implements user login.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var applicationUsername: String?
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Main methods

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func initialize(iapProducts: Array<IAPProduct>, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + iapProducts + + +
    +

    An array of IAPProduct.

    +
    +
    + + validatorUrlString + + +
    +

    The validator url retrieved from Fovea.

    +
    +
    + + iapPurchaseDelegate + + +
    +

    An instance of class that adopts the IAPPurchaseDelegate protocol (default value = DefaultPurchaseDelegate).

    +
    +
    + + applicationUsername + + +
    +

    The user name, if your app implements user login.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + stop() + +
    +
    +
    +
    +
    +
    +

    Stop observing the payment queue, when the application will terminate, for proper cleanup.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func stop()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refresh(callback:) + +
    +
    +
    +
    +
    +
    +

    Refresh Product list and user Receipt.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func refresh(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Products information

+

+
+
+
    +
  • +
    + + + + getProducts() + +
    +
    +
    +
    +
    +
    +

    Gets all products retrieved from the App Store

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getProducts() -> Array<SKProduct>
    + +
    +
    +
    +

    Return Value

    +

    An array of products.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Gets the product by its identifier from the list of products retrieved from the App Store.

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getProductBy(identifier: String) -> SKProduct?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + identifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The product if it was retrieved from the App Store.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchasing and Restoring

+

+
+
+
    +
  • +
    + + + + canMakePayments() + +
    +
    +
    +
    +
    +
    +

    Checks if the user is allowed to authorize payments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func canMakePayments() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user is allowed.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Request a Payment from the App Store.

    +
    +

    See

    + See also:IAPPurchaseCallback and IAPPurchaseResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product to purchase.

    +
    +
    + + quantity + + +
    +

    The quantity to purchase (default value = 1).

    +
    +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Restore purchased products.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func restorePurchases(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Finish all transactions for the product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func finishTransactions(for productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the last transaction state for a given product was deferred.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasDeferredTransaction(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the last transaction state was deferred.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchases information

+

+
+
+
    +
  • +
    + + + + hasAlreadyPurchased() + +
    +
    +
    +
    +
    +
    +

    Checks if the user has already purchased at least one product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasAlreadyPurchased() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the .

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasActivePurchase(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user currently own (or is subscribed to) a given product.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user has an active auto renewable subscription regardless of the product identifier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasActiveSubscription() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user has an active auto renewable subscription.

    +
    +
    +
    +
  • +
  • +
    + + + + getPurchaseDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the latest purchased date for a given product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getPurchaseDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The latest purchase Date if set or nil.

    +
    +
    +
    +
  • +
  • +
    + + + + getExpiryDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the expiry date for a subcription. May be past or future.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getExpiryDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The expiry Date is set or nil.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Enums.html b/docs/jazzy/Enums.html new file mode 100644 index 0000000..b724f25 --- /dev/null +++ b/docs/jazzy/Enums.html @@ -0,0 +1,276 @@ + + + + Enumerations Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPPurchaseResultState
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPRefreshResultState + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPRefreshResultState
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPErrorCode + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPErrorCode
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPProductType + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPProductType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPPeriodFormat + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPPeriodFormat
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Enums/IAPErrorCode.html b/docs/jazzy/Enums/IAPErrorCode.html new file mode 100644 index 0000000..b78db89 --- /dev/null +++ b/docs/jazzy/Enums/IAPErrorCode.html @@ -0,0 +1,412 @@ + + + + IAPErrorCode Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPErrorCode

+
+
+
public enum IAPErrorCode
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + libraryNotInitialized + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case libraryNotInitialized
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + productNotFound + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case productNotFound
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cannotMakePurchase + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cannotMakePurchase
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + alreadyPurchasing + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case alreadyPurchasing
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case bundleIdentifierInvalid
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validatorUrlInvalid + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case validatorUrlInvalid
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshReceiptFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case refreshReceiptFailed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validateReceiptFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case validateReceiptFailed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + readReceiptFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case readReceiptFailed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshProductsFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case refreshProductsFailed
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Enums/IAPPeriodFormat.html b/docs/jazzy/Enums/IAPPeriodFormat.html new file mode 100644 index 0000000..b5080fe --- /dev/null +++ b/docs/jazzy/Enums/IAPPeriodFormat.html @@ -0,0 +1,196 @@ + + + + IAPPeriodFormat Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPeriodFormat

+
+
+
public enum IAPPeriodFormat
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + short + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case short
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + long + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case long
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Enums/IAPProductType.html b/docs/jazzy/Enums/IAPProductType.html new file mode 100644 index 0000000..5f397d9 --- /dev/null +++ b/docs/jazzy/Enums/IAPProductType.html @@ -0,0 +1,250 @@ + + + + IAPProductType Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPProductType

+
+
+
public enum IAPProductType
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + consumable + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case consumable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + nonConsumable + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nonConsumable
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nonRenewingSubscription
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case autoRenewableSubscription
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Enums/IAPPurchaseResultState.html b/docs/jazzy/Enums/IAPPurchaseResultState.html new file mode 100644 index 0000000..ade15de --- /dev/null +++ b/docs/jazzy/Enums/IAPPurchaseResultState.html @@ -0,0 +1,250 @@ + + + + IAPPurchaseResultState Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPurchaseResultState

+
+
+
public enum IAPPurchaseResultState
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + purchased + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case purchased
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cancelled + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cancelled
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + deferred + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferred
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Enums/IAPRefreshResultState.html b/docs/jazzy/Enums/IAPRefreshResultState.html new file mode 100644 index 0000000..ce460b0 --- /dev/null +++ b/docs/jazzy/Enums/IAPRefreshResultState.html @@ -0,0 +1,223 @@ + + + + IAPRefreshResultState Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPRefreshResultState

+
+
+
public enum IAPRefreshResultState
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + succeeded + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case succeeded
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + skipped + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case skipped
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Extensions.html b/docs/jazzy/Extensions.html new file mode 100644 index 0000000..922e9fa --- /dev/null +++ b/docs/jazzy/Extensions.html @@ -0,0 +1,163 @@ + + + + Extensions Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+
+
    +
  • +
    + + + + SKProduct + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension SKProduct
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Extensions/SKProduct.html b/docs/jazzy/Extensions/SKProduct.html new file mode 100644 index 0000000..19d937b --- /dev/null +++ b/docs/jazzy/Extensions/SKProduct.html @@ -0,0 +1,330 @@ + + + + SKProduct Extension Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

SKProduct

+
+
+
extension SKProduct
+ +
+
+ +
+
+
+
    +
  • +
    + + + + localizedPeriodFormat + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var localizedPeriodFormat: IAPPeriodFormat
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the product has an introductory price the user is eligible to.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasIntroductoryPriceEligible() -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localizedPrice + +
    +
    +
    +
    +
    +
    +

    Returns a localized string with the cost of the product in the local currency.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedPrice: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the period of the subscription product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedSubscriptionPeriod: String? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the introductory price if available, in the local currency.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedIntroductoryPrice: String? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the introductory price period of the subscription product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedIntroductoryPeriod: String? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the duration of the introductory price.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedIntroductoryDuration: String? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Protocols.html b/docs/jazzy/Protocols.html new file mode 100644 index 0000000..33bac01 --- /dev/null +++ b/docs/jazzy/Protocols.html @@ -0,0 +1,233 @@ + + + + Protocols Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+
+
    +
  • +
    + + + + IAPErrorProtocol + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol IAPErrorProtocol : LocalizedError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + InAppPurchaseLib + +
    +
    +
    +
    +
    +
    +

    The protocol that InAppPurchase` adopts.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol InAppPurchaseLib
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

The protocol that you must adopt.

+

+
+
+
    +
  • +
    + + + + IAPPurchaseDelegate + +
    +
    +
    +
    +
    +
    +

    The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol IAPPurchaseDelegate
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Protocols/IAPErrorProtocol.html b/docs/jazzy/Protocols/IAPErrorProtocol.html new file mode 100644 index 0000000..39a040c --- /dev/null +++ b/docs/jazzy/Protocols/IAPErrorProtocol.html @@ -0,0 +1,169 @@ + + + + IAPErrorProtocol Protocol Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPErrorProtocol

+
+
+
public protocol IAPErrorProtocol : LocalizedError
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + code + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var code: IAPErrorCode { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Protocols/IAPPurchaseDelegate.html b/docs/jazzy/Protocols/IAPPurchaseDelegate.html new file mode 100644 index 0000000..ced2b91 --- /dev/null +++ b/docs/jazzy/Protocols/IAPPurchaseDelegate.html @@ -0,0 +1,193 @@ + + + + IAPPurchaseDelegate Protocol Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPurchaseDelegate

+
+
+
public protocol IAPPurchaseDelegate
+ +
+
+

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Called when a product is newly purchased, updated or restored.

    +
    +

    Important

    +

    You have to acknowledge delivery of the (virtual) item to finalize the transaction. Then you have to call InAppPurchase.finishTransactions(for: productIdentifier)as soon as you have delivered the product.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func productPurchased(productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Protocols/InAppPurchaseLib.html b/docs/jazzy/Protocols/InAppPurchaseLib.html new file mode 100644 index 0000000..63ceafc --- /dev/null +++ b/docs/jazzy/Protocols/InAppPurchaseLib.html @@ -0,0 +1,1019 @@ + + + + InAppPurchaseLib Protocol Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

InAppPurchaseLib

+
+
+
public protocol InAppPurchaseLib
+ +
+
+

The protocol that InAppPurchase` adopts.

+ +
+
+
+
    +
  • +
    + + + + iapProducts + +
    +
    +
    +
    +
    +
    +

    The array of IAPProduct.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var iapProducts: Array<IAPProduct> { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validatorUrlString + +
    +
    +
    +
    +
    +
    +

    The validator url retrieved from Fovea.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var validatorUrlString: String? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapPurchaseDelegate + +
    +
    +
    +
    +
    +
    +

    The instance of class that adopts the IAPPurchaseDelegate protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var iapPurchaseDelegate: IAPPurchaseDelegate? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + applicationUsername + +
    +
    +
    +
    +
    +
    +

    The user name, if your app implements user login.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var applicationUsername: String? { get set }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func initialize(iapProducts: Array<IAPProduct>, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + iapProducts + + +
    +

    An array of IAPProduct.

    +
    +
    + + validatorUrlString + + +
    +

    The validator url retrieved from Fovea.

    +
    +
    + + iapPurchaseDelegate + + +
    +

    An instance of class that adopts the IAPPurchaseDelegate protocol (default value = DefaultPurchaseDelegate).

    +
    +
    + + applicationUsername + + +
    +

    The user name, if your app implements user login.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + stop() + +
    +
    +
    +
    +
    +
    +

    Stop observing the payment queue, when the application will terminate, for proper cleanup.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func stop()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refresh(callback:) + +
    +
    +
    +
    +
    +
    +

    Refresh Product list and user Receipt.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func refresh(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Products information

+

+
+
+
    +
  • +
    + + + + getProducts() + +
    +
    +
    +
    +
    +
    +

    Gets all products retrieved from the App Store

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getProducts() -> Array<SKProduct>
    + +
    +
    +
    +

    Return Value

    +

    An array of products.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Gets the product by its identifier from the list of products retrieved from the App Store.

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getProductBy(identifier: String) -> SKProduct?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + identifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The product if it was retrieved from the App Store.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchasing and Restoring

+

+
+
+
    +
  • +
    + + + + canMakePayments() + +
    +
    +
    +
    +
    +
    +

    Checks if the user is allowed to authorize payments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func canMakePayments() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user is allowed.

    +
    +
    +
    +
  • +
  • +
    + + + + purchase(productIdentifier:quantity:callback:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Request a Payment from the App Store.

    +
    +

    See

    + See also:IAPPurchaseCallback and IAPPurchaseResult. + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product to purchase.

    +
    +
    + + quantity + + +
    +

    The quantity to purchase (default value = 1).

    +
    +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Restore purchased products.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func restorePurchases(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Finish all transactions for the product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func finishTransactions(for productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the last transaction state for a given product was deferred.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasDeferredTransaction(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the last transaction state was deferred.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchases information

+

+
+
+
    +
  • +
    + + + + hasAlreadyPurchased() + +
    +
    +
    +
    +
    +
    +

    Checks if the user has already purchased at least one product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasAlreadyPurchased() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the .

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasActivePurchase(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user currently own (or is subscribed to) a given product.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user has an active auto renewable subscription regardless of the product identifier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasActiveSubscription() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user has an active auto renewable subscription.

    +
    +
    +
    +
  • +
  • +
    + + + + getPurchaseDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the latest purchased date for a given product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getPurchaseDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The latest purchase Date if set or nil.

    +
    +
    +
    +
  • +
  • +
    + + + + getExpiryDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the expiry date for a subcription. May be past or future.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getExpiryDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The expiry Date is set or nil.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Structs.html b/docs/jazzy/Structs.html new file mode 100644 index 0000000..7b7bec2 --- /dev/null +++ b/docs/jazzy/Structs.html @@ -0,0 +1,248 @@ + + + + Structures Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Structures

+

The following structures are available globally.

+ +
+
+
+
    +
  • +
    + + + + IAPPurchaseResult + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPPurchaseResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPRefreshResult + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPRefreshResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPError : IAPErrorProtocol
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPProduct + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPProduct
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Structs/IAPError.html b/docs/jazzy/Structs/IAPError.html new file mode 100644 index 0000000..b1e121c --- /dev/null +++ b/docs/jazzy/Structs/IAPError.html @@ -0,0 +1,196 @@ + + + + IAPError Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPError

+
+
+
public struct IAPError : IAPErrorProtocol
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + code + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var code: IAPErrorCode
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localizedDescription + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Structs/IAPProduct.html b/docs/jazzy/Structs/IAPProduct.html new file mode 100644 index 0000000..889974f --- /dev/null +++ b/docs/jazzy/Structs/IAPProduct.html @@ -0,0 +1,264 @@ + + + + IAPProduct Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPProduct

+
+
+
public struct IAPProduct
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + productIdentifier + +
    +
    +
    +
    +
    +
    +

    The identifier of the product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var productIdentifier: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + productType + +
    +
    +
    +
    +
    +
    +

    The type of the product.

    +
    +

    See

    + See also: IAPProductType. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var productType: IAPProductType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an IAPProduct with its identifier and type.

    +
    +

    See

    + See also: IAPProductType. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(productIdentifier: String, productType: IAPProductType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    + + productType + + +
    +

    The type of the product.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Structs/IAPPurchaseResult.html b/docs/jazzy/Structs/IAPPurchaseResult.html new file mode 100644 index 0000000..6bc3b5d --- /dev/null +++ b/docs/jazzy/Structs/IAPPurchaseResult.html @@ -0,0 +1,250 @@ + + + + IAPPurchaseResult Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPurchaseResult

+
+
+
public struct IAPPurchaseResult
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + state + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var state: IAPPurchaseResultState { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var iapError: IAPError? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + skError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var skError: SKError? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localizedDescription + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedDescription: String? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Structs/IAPRefreshResult.html b/docs/jazzy/Structs/IAPRefreshResult.html new file mode 100644 index 0000000..8d70385 --- /dev/null +++ b/docs/jazzy/Structs/IAPRefreshResult.html @@ -0,0 +1,250 @@ + + + + IAPRefreshResult Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPRefreshResult

+
+
+
public struct IAPRefreshResult
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + state + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var state: IAPRefreshResultState { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var iapError: IAPError? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addedPurchases + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var addedPurchases: Int { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + updatedPurchases + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var updatedPurchases: Int { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/Typealiases.html b/docs/jazzy/Typealiases.html new file mode 100644 index 0000000..17dd0f5 --- /dev/null +++ b/docs/jazzy/Typealiases.html @@ -0,0 +1,190 @@ + + + + Type Aliases Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/jazzy/badge.svg b/docs/jazzy/badge.svg new file mode 100644 index 0000000..81f3c9b --- /dev/null +++ b/docs/jazzy/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 52% + + + 52% + + + diff --git a/docs/jazzy/css/highlight.css b/docs/jazzy/css/highlight.css new file mode 100644 index 0000000..d0db0e1 --- /dev/null +++ b/docs/jazzy/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/jazzy/css/jazzy.css b/docs/jazzy/css/jazzy.css new file mode 100644 index 0000000..c3090c0 --- /dev/null +++ b/docs/jazzy/css/jazzy.css @@ -0,0 +1,374 @@ +html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { + background: transparent; + border: 0; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; } + +body { + background-color: #f2f2f2; + font-family: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + -webkit-font-smoothing: subpixel-antialiased; + word-wrap: break-word; } + +h1, h2, h3 { + margin-top: 0.8em; + margin-bottom: 0.3em; + font-weight: 100; + color: black; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 2em; + border-bottom: 1px solid #e2e2e2; } + +h4 { + font-size: 13px; + line-height: 1.5; + margin-top: 21px; } + +h5 { + font-size: 1.1em; } + +h6 { + font-size: 1.1em; + color: #777; } + +.section-name { + color: gray; + display: block; + font-family: Helvetica; + font-size: 22px; + font-weight: 100; + margin-bottom: 15px; } + +pre, code { + font: 0.95em Menlo, monospace; + color: #777; + word-wrap: normal; } + +p code, li code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; } + +a { + color: #0088cc; + text-decoration: none; } + +ul { + padding-left: 15px; } + +li { + line-height: 1.8em; } + +img { + max-width: 100%; } + +blockquote { + margin-left: 0; + padding: 0 10px; + border-left: 4px solid #ccc; } + +.content-wrapper { + margin: 0 auto; + width: 980px; } + +header { + font-size: 0.85em; + line-height: 26px; + background-color: #414141; + position: fixed; + width: 100%; + z-index: 2; } + header img { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + header a { + color: #fff; } + header p { + float: left; + color: #999; } + header .header-right { + float: right; + margin-left: 16px; } + +#breadcrumbs { + background-color: #f2f2f2; + height: 27px; + padding-top: 17px; + position: fixed; + width: 100%; + z-index: 2; + margin-top: 26px; } + #breadcrumbs #carat { + height: 10px; + margin: 0 5px; } + +.sidebar { + background-color: #f9f9f9; + border: 1px solid #e2e2e2; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 70px; + bottom: 0; + width: 230px; + word-wrap: normal; } + +.nav-groups { + list-style-type: none; + background: #fff; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #e2e2e2; + font-size: 1.1em; + font-weight: 100; + padding: 15px 0 15px 20px; } + .nav-group-name > a { + color: #333; } + +.nav-group-tasks { + margin-top: 5px; } + +.nav-group-task { + font-size: 0.9em; + list-style-type: none; + white-space: nowrap; } + .nav-group-task a { + color: #888; } + +.main-content { + background-color: #fff; + border: 1px solid #e2e2e2; + margin-left: 246px; + position: absolute; + overflow: hidden; + padding-bottom: 20px; + top: 70px; + width: 734px; } + .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { + margin-bottom: 1em; } + .main-content p { + line-height: 1.8em; } + .main-content section .section:first-child { + margin-top: 0; + padding-top: 0; } + .main-content section .task-group-section .task-group:first-of-type { + padding-top: 10px; } + .main-content section .task-group-section .task-group:first-of-type .section-name { + padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .main-content .section-name p { + margin-bottom: inherit; + line-height: inherit; } + .main-content .section-name code { + background-color: inherit; + padding: inherit; + color: inherit; } + +.section { + padding: 0 25px; } + +.highlight { + background-color: #eee; + padding: 10px 12px; + border: 1px solid #e2e2e2; + border-radius: 4px; + overflow-x: auto; } + +.declaration .highlight { + overflow-x: initial; + padding: 0 40px 40px 0; + margin-bottom: -25px; + background-color: transparent; + border: none; } + +.section-name { + margin: 0; + margin-left: 18px; } + +.task-group-section { + padding-left: 6px; + border-top: 1px solid #e2e2e2; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.section-name-container { + position: relative; + display: inline-block; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .item code { + background-color: transparent; + padding: 0; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 35px; + font-size: 11.9px; + transition: all 300ms; } + .item .token-open { + margin-left: 20px; } + .item .discouraged { + text-decoration: line-through; } + .item .declaration-note { + font-size: .85em; + color: gray; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #e2e2e2; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + background: #f9f9f9; + border-left: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; + height: 12px; + left: 21px; + top: -7px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + width: 12px; } + +.height-container { + display: none; + left: -25px; + padding: 0 25px; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #f9f9f9; + border-bottom: 1px solid #e2e2e2; + left: -25px; + position: relative; + width: 100%; + padding-top: 10px; + padding-bottom: 5px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4b8afb; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #e2e2e2; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +#footer { + position: relative; + top: 10px; + bottom: 0px; + margin-left: 25px; } + #footer p { + margin: 0; + color: #aaa; + font-size: 0.8em; } + +html.dash header, html.dash #breadcrumbs, html.dash .sidebar { + display: none; } + +html.dash .main-content { + width: 980px; + margin-left: 0; + border: none; + width: 100%; + top: 0; + padding-bottom: 0; } + +html.dash .height-container { + display: block; } + +html.dash .item .token { + margin-left: 0; } + +html.dash .content-wrapper { + width: auto; } + +html.dash #footer { + position: static; } diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Info.plist b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Info.plist new file mode 100644 index 0000000..bced676 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + com.jazzy.inapppurchaselib + CFBundleName + InAppPurchaseLib + DocSetPlatformFamily + inapppurchaselib + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes.html new file mode 100644 index 0000000..d33eafb --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes.html @@ -0,0 +1,205 @@ + + + + Classes Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Classes

+

The following classes are available globally.

+ +
+
+
+ +
+
+
+ + +
+ +

The protocol that you must adopt.

+

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes/DefaultPurchaseDelegate.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes/DefaultPurchaseDelegate.html new file mode 100644 index 0000000..3a8424b --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes/DefaultPurchaseDelegate.html @@ -0,0 +1,215 @@ + + + + DefaultPurchaseDelegate Class Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

DefaultPurchaseDelegate

+
+
+
public class DefaultPurchaseDelegate : IAPPurchaseDelegate
+ +
+
+

The default implementation of IAPPurchaseDelegate if no other is provided.

+ +
+
+
+
    +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Finish the product transactions when a product is newly purchased, updated or restored.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func productPurchased(productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes/InAppPurchase.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes/InAppPurchase.html new file mode 100644 index 0000000..b43f50e --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Classes/InAppPurchase.html @@ -0,0 +1,1027 @@ + + + + InAppPurchase Class Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

InAppPurchase

+
+
+
public class InAppPurchase : NSObject, InAppPurchaseLib
+ +
+
+

Undocumented

+ +
+
+
+
+ + +
+ +

Properties

+

+
+
+
    +
  • +
    + + + + iapProducts + +
    +
    +
    +
    +
    +
    +

    The array of IAPProduct.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var iapProducts: Array<IAPProduct>
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validatorUrlString + +
    +
    +
    +
    +
    +
    +

    The validator url retrieved from Fovea.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var validatorUrlString: String?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapPurchaseDelegate + +
    +
    +
    +
    +
    +
    +

    The instance of class that adopts the IAPPurchaseDelegate protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var iapPurchaseDelegate: IAPPurchaseDelegate?
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + applicationUsername + +
    +
    +
    +
    +
    +
    +

    The user name, if your app implements user login.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var applicationUsername: String?
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Main methods

+

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func initialize(iapProducts: Array<IAPProduct>, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + iapProducts + + +
    +

    An array of IAPProduct.

    +
    +
    + + validatorUrlString + + +
    +

    The validator url retrieved from Fovea.

    +
    +
    + + iapPurchaseDelegate + + +
    +

    An instance of class that adopts the IAPPurchaseDelegate protocol (default value = DefaultPurchaseDelegate).

    +
    +
    + + applicationUsername + + +
    +

    The user name, if your app implements user login.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + stop() + +
    +
    +
    +
    +
    +
    +

    Stop observing the payment queue, when the application will terminate, for proper cleanup.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func stop()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refresh(callback:) + +
    +
    +
    +
    +
    +
    +

    Refresh Product list and user Receipt.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func refresh(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Products information

+

+
+
+
    +
  • +
    + + + + getProducts() + +
    +
    +
    +
    +
    +
    +

    Gets all products retrieved from the App Store

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getProducts() -> Array<SKProduct>
    + +
    +
    +
    +

    Return Value

    +

    An array of products.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Gets the product by its identifier from the list of products retrieved from the App Store.

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getProductBy(identifier: String) -> SKProduct?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + identifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The product if it was retrieved from the App Store.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchasing and Restoring

+

+
+
+
    +
  • +
    + + + + canMakePayments() + +
    +
    +
    +
    +
    +
    +

    Checks if the user is allowed to authorize payments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func canMakePayments() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user is allowed.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Request a Payment from the App Store.

    +
    +

    See

    + See also:IAPPurchaseCallback and IAPPurchaseResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product to purchase.

    +
    +
    + + quantity + + +
    +

    The quantity to purchase (default value = 1).

    +
    +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Restore purchased products.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func restorePurchases(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Finish all transactions for the product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func finishTransactions(for productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the last transaction state for a given product was deferred.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasDeferredTransaction(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the last transaction state was deferred.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchases information

+

+
+
+
    +
  • +
    + + + + hasAlreadyPurchased() + +
    +
    +
    +
    +
    +
    +

    Checks if the user has already purchased at least one product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasAlreadyPurchased() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the .

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasActivePurchase(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user currently own (or is subscribed to) a given product.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user has an active auto renewable subscription regardless of the product identifier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func hasActiveSubscription() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user has an active auto renewable subscription.

    +
    +
    +
    +
  • +
  • +
    + + + + getPurchaseDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the latest purchased date for a given product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getPurchaseDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The latest purchase Date if set or nil.

    +
    +
    +
    +
  • +
  • +
    + + + + getExpiryDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the expiry date for a subcription. May be past or future.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func getExpiryDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The expiry Date is set or nil.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums.html new file mode 100644 index 0000000..b724f25 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums.html @@ -0,0 +1,276 @@ + + + + Enumerations Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPPurchaseResultState
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPRefreshResultState + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPRefreshResultState
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPErrorCode + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPErrorCode
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPProductType + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPProductType
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPPeriodFormat + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum IAPPeriodFormat
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPErrorCode.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPErrorCode.html new file mode 100644 index 0000000..b78db89 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPErrorCode.html @@ -0,0 +1,412 @@ + + + + IAPErrorCode Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPErrorCode

+
+
+
public enum IAPErrorCode
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + libraryNotInitialized + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case libraryNotInitialized
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + productNotFound + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case productNotFound
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cannotMakePurchase + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cannotMakePurchase
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + alreadyPurchasing + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case alreadyPurchasing
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case bundleIdentifierInvalid
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validatorUrlInvalid + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case validatorUrlInvalid
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshReceiptFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case refreshReceiptFailed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validateReceiptFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case validateReceiptFailed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + readReceiptFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case readReceiptFailed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refreshProductsFailed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case refreshProductsFailed
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPPeriodFormat.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPPeriodFormat.html new file mode 100644 index 0000000..b5080fe --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPPeriodFormat.html @@ -0,0 +1,196 @@ + + + + IAPPeriodFormat Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPeriodFormat

+
+
+
public enum IAPPeriodFormat
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + short + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case short
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + long + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case long
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPProductType.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPProductType.html new file mode 100644 index 0000000..5f397d9 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPProductType.html @@ -0,0 +1,250 @@ + + + + IAPProductType Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPProductType

+
+
+
public enum IAPProductType
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + consumable + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case consumable
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + nonConsumable + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nonConsumable
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case nonRenewingSubscription
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case autoRenewableSubscription
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPPurchaseResultState.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPPurchaseResultState.html new file mode 100644 index 0000000..ade15de --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPPurchaseResultState.html @@ -0,0 +1,250 @@ + + + + IAPPurchaseResultState Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPurchaseResultState

+
+
+
public enum IAPPurchaseResultState
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + purchased + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case purchased
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + cancelled + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case cancelled
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + deferred + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case deferred
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPRefreshResultState.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPRefreshResultState.html new file mode 100644 index 0000000..ce460b0 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Enums/IAPRefreshResultState.html @@ -0,0 +1,223 @@ + + + + IAPRefreshResultState Enumeration Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPRefreshResultState

+
+
+
public enum IAPRefreshResultState
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + succeeded + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case succeeded
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + failed + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case failed
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + skipped + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case skipped
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Extensions.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 0000000..922e9fa --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,163 @@ + + + + Extensions Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+
+
    +
  • +
    + + + + SKProduct + +
    +
    +
    +
    +
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    extension SKProduct
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Extensions/SKProduct.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Extensions/SKProduct.html new file mode 100644 index 0000000..19d937b --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Extensions/SKProduct.html @@ -0,0 +1,330 @@ + + + + SKProduct Extension Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

SKProduct

+
+
+
extension SKProduct
+ +
+
+ +
+
+
+
    +
  • +
    + + + + localizedPeriodFormat + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var localizedPeriodFormat: IAPPeriodFormat
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the product has an introductory price the user is eligible to.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hasIntroductoryPriceEligible() -> Bool
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localizedPrice + +
    +
    +
    +
    +
    +
    +

    Returns a localized string with the cost of the product in the local currency.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedPrice: String { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the period of the subscription product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedSubscriptionPeriod: String? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the introductory price if available, in the local currency.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedIntroductoryPrice: String? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the introductory price period of the subscription product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedIntroductoryPeriod: String? { get }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a localized string with the duration of the introductory price.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedIntroductoryDuration: String? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 0000000..33bac01 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,233 @@ + + + + Protocols Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+
+
    +
  • +
    + + + + IAPErrorProtocol + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol IAPErrorProtocol : LocalizedError
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + InAppPurchaseLib + +
    +
    +
    +
    +
    +
    +

    The protocol that InAppPurchase` adopts.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol InAppPurchaseLib
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

The protocol that you must adopt.

+

+
+
+
    +
  • +
    + + + + IAPPurchaseDelegate + +
    +
    +
    +
    +
    +
    +

    The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol IAPPurchaseDelegate
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/IAPErrorProtocol.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/IAPErrorProtocol.html new file mode 100644 index 0000000..39a040c --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/IAPErrorProtocol.html @@ -0,0 +1,169 @@ + + + + IAPErrorProtocol Protocol Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPErrorProtocol

+
+
+
public protocol IAPErrorProtocol : LocalizedError
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + code + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var code: IAPErrorCode { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/IAPPurchaseDelegate.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/IAPPurchaseDelegate.html new file mode 100644 index 0000000..ced2b91 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/IAPPurchaseDelegate.html @@ -0,0 +1,193 @@ + + + + IAPPurchaseDelegate Protocol Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPurchaseDelegate

+
+
+
public protocol IAPPurchaseDelegate
+ +
+
+

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Called when a product is newly purchased, updated or restored.

    +
    +

    Important

    +

    You have to acknowledge delivery of the (virtual) item to finalize the transaction. Then you have to call InAppPurchase.finishTransactions(for: productIdentifier)as soon as you have delivered the product.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func productPurchased(productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/InAppPurchaseLib.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/InAppPurchaseLib.html new file mode 100644 index 0000000..63ceafc --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Protocols/InAppPurchaseLib.html @@ -0,0 +1,1019 @@ + + + + InAppPurchaseLib Protocol Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

InAppPurchaseLib

+
+
+
public protocol InAppPurchaseLib
+ +
+
+

The protocol that InAppPurchase` adopts.

+ +
+
+
+
    +
  • +
    + + + + iapProducts + +
    +
    +
    +
    +
    +
    +

    The array of IAPProduct.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var iapProducts: Array<IAPProduct> { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + validatorUrlString + +
    +
    +
    +
    +
    +
    +

    The validator url retrieved from Fovea.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var validatorUrlString: String? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapPurchaseDelegate + +
    +
    +
    +
    +
    +
    +

    The instance of class that adopts the IAPPurchaseDelegate protocol.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var iapPurchaseDelegate: IAPPurchaseDelegate? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + applicationUsername + +
    +
    +
    +
    +
    +
    +

    The user name, if your app implements user login.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var applicationUsername: String? { get set }
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func initialize(iapProducts: Array<IAPProduct>, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + iapProducts + + +
    +

    An array of IAPProduct.

    +
    +
    + + validatorUrlString + + +
    +

    The validator url retrieved from Fovea.

    +
    +
    + + iapPurchaseDelegate + + +
    +

    An instance of class that adopts the IAPPurchaseDelegate protocol (default value = DefaultPurchaseDelegate).

    +
    +
    + + applicationUsername + + +
    +

    The user name, if your app implements user login.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + stop() + +
    +
    +
    +
    +
    +
    +

    Stop observing the payment queue, when the application will terminate, for proper cleanup.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func stop()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + refresh(callback:) + +
    +
    +
    +
    +
    +
    +

    Refresh Product list and user Receipt.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func refresh(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Products information

+

+
+
+
    +
  • +
    + + + + getProducts() + +
    +
    +
    +
    +
    +
    +

    Gets all products retrieved from the App Store

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getProducts() -> Array<SKProduct>
    + +
    +
    +
    +

    Return Value

    +

    An array of products.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Gets the product by its identifier from the list of products retrieved from the App Store.

    +
    +

    See

    + See also: SKProduct. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getProductBy(identifier: String) -> SKProduct?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + identifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The product if it was retrieved from the App Store.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchasing and Restoring

+

+
+
+
    +
  • +
    + + + + canMakePayments() + +
    +
    +
    +
    +
    +
    +

    Checks if the user is allowed to authorize payments.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func canMakePayments() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user is allowed.

    +
    +
    +
    +
  • +
  • +
    + + + + purchase(productIdentifier:quantity:callback:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Request a Payment from the App Store.

    +
    +

    See

    + See also:IAPPurchaseCallback and IAPPurchaseResult. + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product to purchase.

    +
    +
    + + quantity + + +
    +

    The quantity to purchase (default value = 1).

    +
    +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Restore purchased products.

    +
    +

    See

    + See also:IAPRefreshCallback and IAPRefreshResult. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func restorePurchases(callback: @escaping IAPRefreshCallback)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + callback + + +
    +

    The function that will be called after processing.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Finish all transactions for the product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func finishTransactions(for productIdentifier: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the last transaction state for a given product was deferred.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasDeferredTransaction(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the last transaction state was deferred.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Purchases information

+

+
+
+
    +
  • +
    + + + + hasAlreadyPurchased() + +
    +
    +
    +
    +
    +
    +

    Checks if the user has already purchased at least one product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasAlreadyPurchased() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the .

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasActivePurchase(for productIdentifier: String) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user currently own (or is subscribed to) a given product.

    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Checks if the user has an active auto renewable subscription regardless of the product identifier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func hasActiveSubscription() -> Bool
    + +
    +
    +
    +

    Return Value

    +

    A boolean indicates if the user has an active auto renewable subscription.

    +
    +
    +
    +
  • +
  • +
    + + + + getPurchaseDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the latest purchased date for a given product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getPurchaseDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The latest purchase Date if set or nil.

    +
    +
    +
    +
  • +
  • +
    + + + + getExpiryDate(for:) + +
    +
    +
    +
    +
    +
    +

    Returns the expiry date for a subcription. May be past or future.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func getExpiryDate(for productIdentifier: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    +
    +
    +

    Return Value

    +

    The expiry Date is set or nil.

    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 0000000..7b7bec2 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,248 @@ + + + + Structures Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Structures

+

The following structures are available globally.

+ +
+
+
+
    +
  • +
    + + + + IAPPurchaseResult + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPPurchaseResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPRefreshResult + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPRefreshResult
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPError : IAPErrorProtocol
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + IAPProduct + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct IAPProduct
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPError.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPError.html new file mode 100644 index 0000000..b1e121c --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPError.html @@ -0,0 +1,196 @@ + + + + IAPError Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPError

+
+
+
public struct IAPError : IAPErrorProtocol
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + code + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var code: IAPErrorCode
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localizedDescription + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedDescription: String { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPProduct.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPProduct.html new file mode 100644 index 0000000..889974f --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPProduct.html @@ -0,0 +1,264 @@ + + + + IAPProduct Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPProduct

+
+
+
public struct IAPProduct
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + productIdentifier + +
    +
    +
    +
    +
    +
    +

    The identifier of the product.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var productIdentifier: String
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + productType + +
    +
    +
    +
    +
    +
    +

    The type of the product.

    +
    +

    See

    + See also: IAPProductType. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var productType: IAPProductType
    + +
    +
    +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Initializes an IAPProduct with its identifier and type.

    +
    +

    See

    + See also: IAPProductType. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(productIdentifier: String, productType: IAPProductType)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + productIdentifier + + +
    +

    The identifier of the product.

    +
    +
    + + productType + + +
    +

    The type of the product.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPPurchaseResult.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPPurchaseResult.html new file mode 100644 index 0000000..6bc3b5d --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPPurchaseResult.html @@ -0,0 +1,250 @@ + + + + IAPPurchaseResult Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPPurchaseResult

+
+
+
public struct IAPPurchaseResult
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + state + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var state: IAPPurchaseResultState { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var iapError: IAPError? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + skError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var skError: SKError? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + localizedDescription + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var localizedDescription: String? { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPRefreshResult.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPRefreshResult.html new file mode 100644 index 0000000..8d70385 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Structs/IAPRefreshResult.html @@ -0,0 +1,250 @@ + + + + IAPRefreshResult Structure Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

IAPRefreshResult

+
+
+
public struct IAPRefreshResult
+ +
+
+

Undocumented

+ +
+
+
+
    +
  • +
    + + + + state + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var state: IAPRefreshResultState { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + iapError + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var iapError: IAPError? { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + addedPurchases + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var addedPurchases: Int { get }
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + updatedPurchases + +
    +
    +
    +
    +
    +
    +

    Undocumented

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public internal(set) var updatedPurchases: Int { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Typealiases.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Typealiases.html new file mode 100644 index 0000000..17dd0f5 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/Typealiases.html @@ -0,0 +1,190 @@ + + + + Type Aliases Reference + + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+

Type Aliases

+

The following type aliases are available globally.

+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/css/highlight.css b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 0000000..d0db0e1 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,200 @@ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight { + /* Comment */ + /* Error */ + /* Keyword */ + /* Operator */ + /* Comment.Multiline */ + /* Comment.Preproc */ + /* Comment.Single */ + /* Comment.Special */ + /* Generic.Deleted */ + /* Generic.Deleted.Specific */ + /* Generic.Emph */ + /* Generic.Error */ + /* Generic.Heading */ + /* Generic.Inserted */ + /* Generic.Inserted.Specific */ + /* Generic.Output */ + /* Generic.Prompt */ + /* Generic.Strong */ + /* Generic.Subheading */ + /* Generic.Traceback */ + /* Keyword.Constant */ + /* Keyword.Declaration */ + /* Keyword.Pseudo */ + /* Keyword.Reserved */ + /* Keyword.Type */ + /* Literal.Number */ + /* Literal.String */ + /* Name.Attribute */ + /* Name.Builtin */ + /* Name.Class */ + /* Name.Constant */ + /* Name.Entity */ + /* Name.Exception */ + /* Name.Function */ + /* Name.Namespace */ + /* Name.Tag */ + /* Name.Variable */ + /* Operator.Word */ + /* Text.Whitespace */ + /* Literal.Number.Float */ + /* Literal.Number.Hex */ + /* Literal.Number.Integer */ + /* Literal.Number.Oct */ + /* Literal.String.Backtick */ + /* Literal.String.Char */ + /* Literal.String.Doc */ + /* Literal.String.Double */ + /* Literal.String.Escape */ + /* Literal.String.Heredoc */ + /* Literal.String.Interpol */ + /* Literal.String.Other */ + /* Literal.String.Regex */ + /* Literal.String.Single */ + /* Literal.String.Symbol */ + /* Name.Builtin.Pseudo */ + /* Name.Variable.Class */ + /* Name.Variable.Global */ + /* Name.Variable.Instance */ + /* Literal.Number.Integer.Long */ } + .highlight .c { + color: #999988; + font-style: italic; } + .highlight .err { + color: #a61717; + background-color: #e3d2d2; } + .highlight .k { + color: #000000; + font-weight: bold; } + .highlight .o { + color: #000000; + font-weight: bold; } + .highlight .cm { + color: #999988; + font-style: italic; } + .highlight .cp { + color: #999999; + font-weight: bold; } + .highlight .c1 { + color: #999988; + font-style: italic; } + .highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + .highlight .gd { + color: #000000; + background-color: #ffdddd; } + .highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + .highlight .ge { + color: #000000; + font-style: italic; } + .highlight .gr { + color: #aa0000; } + .highlight .gh { + color: #999999; } + .highlight .gi { + color: #000000; + background-color: #ddffdd; } + .highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + .highlight .go { + color: #888888; } + .highlight .gp { + color: #555555; } + .highlight .gs { + font-weight: bold; } + .highlight .gu { + color: #aaaaaa; } + .highlight .gt { + color: #aa0000; } + .highlight .kc { + color: #000000; + font-weight: bold; } + .highlight .kd { + color: #000000; + font-weight: bold; } + .highlight .kp { + color: #000000; + font-weight: bold; } + .highlight .kr { + color: #000000; + font-weight: bold; } + .highlight .kt { + color: #445588; } + .highlight .m { + color: #009999; } + .highlight .s { + color: #d14; } + .highlight .na { + color: #008080; } + .highlight .nb { + color: #0086B3; } + .highlight .nc { + color: #445588; + font-weight: bold; } + .highlight .no { + color: #008080; } + .highlight .ni { + color: #800080; } + .highlight .ne { + color: #990000; + font-weight: bold; } + .highlight .nf { + color: #990000; } + .highlight .nn { + color: #555555; } + .highlight .nt { + color: #000080; } + .highlight .nv { + color: #008080; } + .highlight .ow { + color: #000000; + font-weight: bold; } + .highlight .w { + color: #bbbbbb; } + .highlight .mf { + color: #009999; } + .highlight .mh { + color: #009999; } + .highlight .mi { + color: #009999; } + .highlight .mo { + color: #009999; } + .highlight .sb { + color: #d14; } + .highlight .sc { + color: #d14; } + .highlight .sd { + color: #d14; } + .highlight .s2 { + color: #d14; } + .highlight .se { + color: #d14; } + .highlight .sh { + color: #d14; } + .highlight .si { + color: #d14; } + .highlight .sx { + color: #d14; } + .highlight .sr { + color: #009926; } + .highlight .s1 { + color: #d14; } + .highlight .ss { + color: #990073; } + .highlight .bp { + color: #999999; } + .highlight .vc { + color: #008080; } + .highlight .vg { + color: #008080; } + .highlight .vi { + color: #008080; } + .highlight .il { + color: #009999; } diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/css/jazzy.css b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 0000000..c3090c0 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,374 @@ +html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { + background: transparent; + border: 0; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; } + +body { + background-color: #f2f2f2; + font-family: Helvetica, freesans, Arial, sans-serif; + font-size: 14px; + -webkit-font-smoothing: subpixel-antialiased; + word-wrap: break-word; } + +h1, h2, h3 { + margin-top: 0.8em; + margin-bottom: 0.3em; + font-weight: 100; + color: black; } + +h1 { + font-size: 2.5em; } + +h2 { + font-size: 2em; + border-bottom: 1px solid #e2e2e2; } + +h4 { + font-size: 13px; + line-height: 1.5; + margin-top: 21px; } + +h5 { + font-size: 1.1em; } + +h6 { + font-size: 1.1em; + color: #777; } + +.section-name { + color: gray; + display: block; + font-family: Helvetica; + font-size: 22px; + font-weight: 100; + margin-bottom: 15px; } + +pre, code { + font: 0.95em Menlo, monospace; + color: #777; + word-wrap: normal; } + +p code, li code { + background-color: #eee; + padding: 2px 4px; + border-radius: 4px; } + +a { + color: #0088cc; + text-decoration: none; } + +ul { + padding-left: 15px; } + +li { + line-height: 1.8em; } + +img { + max-width: 100%; } + +blockquote { + margin-left: 0; + padding: 0 10px; + border-left: 4px solid #ccc; } + +.content-wrapper { + margin: 0 auto; + width: 980px; } + +header { + font-size: 0.85em; + line-height: 26px; + background-color: #414141; + position: fixed; + width: 100%; + z-index: 2; } + header img { + padding-right: 6px; + vertical-align: -4px; + height: 16px; } + header a { + color: #fff; } + header p { + float: left; + color: #999; } + header .header-right { + float: right; + margin-left: 16px; } + +#breadcrumbs { + background-color: #f2f2f2; + height: 27px; + padding-top: 17px; + position: fixed; + width: 100%; + z-index: 2; + margin-top: 26px; } + #breadcrumbs #carat { + height: 10px; + margin: 0 5px; } + +.sidebar { + background-color: #f9f9f9; + border: 1px solid #e2e2e2; + overflow-y: auto; + overflow-x: hidden; + position: fixed; + top: 70px; + bottom: 0; + width: 230px; + word-wrap: normal; } + +.nav-groups { + list-style-type: none; + background: #fff; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #e2e2e2; + font-size: 1.1em; + font-weight: 100; + padding: 15px 0 15px 20px; } + .nav-group-name > a { + color: #333; } + +.nav-group-tasks { + margin-top: 5px; } + +.nav-group-task { + font-size: 0.9em; + list-style-type: none; + white-space: nowrap; } + .nav-group-task a { + color: #888; } + +.main-content { + background-color: #fff; + border: 1px solid #e2e2e2; + margin-left: 246px; + position: absolute; + overflow: hidden; + padding-bottom: 20px; + top: 70px; + width: 734px; } + .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { + margin-bottom: 1em; } + .main-content p { + line-height: 1.8em; } + .main-content section .section:first-child { + margin-top: 0; + padding-top: 0; } + .main-content section .task-group-section .task-group:first-of-type { + padding-top: 10px; } + .main-content section .task-group-section .task-group:first-of-type .section-name { + padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .main-content .section-name p { + margin-bottom: inherit; + line-height: inherit; } + .main-content .section-name code { + background-color: inherit; + padding: inherit; + color: inherit; } + +.section { + padding: 0 25px; } + +.highlight { + background-color: #eee; + padding: 10px 12px; + border: 1px solid #e2e2e2; + border-radius: 4px; + overflow-x: auto; } + +.declaration .highlight { + overflow-x: initial; + padding: 0 40px 40px 0; + margin-bottom: -25px; + background-color: transparent; + border: none; } + +.section-name { + margin: 0; + margin-left: 18px; } + +.task-group-section { + padding-left: 6px; + border-top: 1px solid #e2e2e2; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + +.section-name-container { + position: relative; + display: inline-block; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } + .item code { + background-color: transparent; + padding: 0; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 35px; + font-size: 11.9px; + transition: all 300ms; } + .item .token-open { + margin-left: 20px; } + .item .discouraged { + text-decoration: line-through; } + .item .declaration-note { + font-size: .85em; + color: gray; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #e2e2e2; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + background: #f9f9f9; + border-left: 1px solid #e2e2e2; + border-top: 1px solid #e2e2e2; + height: 12px; + left: 21px; + top: -7px; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + width: 12px; } + +.height-container { + display: none; + left: -25px; + padding: 0 25px; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #f9f9f9; + border-bottom: 1px solid #e2e2e2; + left: -25px; + position: relative; + width: 100%; + padding-top: 10px; + padding-bottom: 5px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4b8afb; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #e2e2e2; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +#footer { + position: relative; + top: 10px; + bottom: 0px; + margin-left: 25px; } + #footer p { + margin: 0; + color: #aaa; + font-size: 0.8em; } + +html.dash header, html.dash #breadcrumbs, html.dash .sidebar { + display: none; } + +html.dash .main-content { + width: 980px; + margin-left: 0; + border: none; + width: 100%; + top: 0; + padding-bottom: 0; } + +html.dash .height-container { + display: block; } + +html.dash .item .token { + margin-left: 0; } + +html.dash .content-wrapper { + width: auto; } + +html.dash #footer { + position: static; } diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/carat.png b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 0000000..29d2f7f Binary files /dev/null and b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/carat.png differ diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/dash.png b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 0000000..6f694c7 Binary files /dev/null and b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/dash.png differ diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/gh.png b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/gh.png new file mode 100755 index 0000000..628da97 Binary files /dev/null and b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/img/gh.png differ diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/index.html b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/index.html new file mode 100644 index 0000000..e633951 --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,699 @@ + + + + InAppPurchaseLib Reference + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+ +

+ +

+ +
+

An easy-to-use library for In-App Purchases, using Fovea.Billing for receipts validation.

+
+ + +

Features

+ +
    +
  • ✅ Purchase a product
  • +
  • ✅ Restore purchased products
  • +
  • ✅ Verify transactions with the App Store on Fovea.Billing server
  • +
  • ✅ Handle and notify payment transaction states
  • +
  • ✅ Retreive products information from the App Store
  • +
  • ✅ Support all product types (consumable, non-consumable, auto-renewable subscription, non-renewing subscription)
  • +
  • ✅ Status of purchases available when offline
  • +
  • ✅ Server integration with a Webhook
  • +
+

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

+ +

+ +

+ +
    +
  • Select your project in Xcode
  • +
  • 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
  • +
  • Make sure your project is selected in Add to target
  • +
  • Click on Finish
  • +
+ +

Note: You have to import InAppPurchaseLib wherever you use the library.

+

Usage

+ +

The process of implementing in-app purchases involves several steps:

+ +
    +
  1. Displaying the list of purchasable products
  2. +
  3. Initiating a purchase
  4. +
  5. Delivering and finalizing a purchase
  6. +
  7. Checking the current ownership of non-consumables and subscriptions
  8. +
  9. Implementing the Restore Purchases button
  10. +
+

Initialization

+ +

Before everything else the library must be initialized. This has to happen as soon as possible. A good way is to call the InAppPurchase.initialize() method when the application did finish launching. In the background, this will load your products and refresh the status of purchases and subscriptions.

+ +

InAppPurchase.initialize() accepts the following arguments:

+ +
    +
  • iapProducts - An array of IAPProduct (REQUIRED)
  • +
  • validatorUrlString - The validator url retrieved from Fovea (REQUIRED)
  • +
  • applicationUsername - The user name, if your app implements user login (optional)
  • +
+ +

Each IAPProduct contains the following fields:

+ +
    +
  • productIdentifier - The product unique identifier
  • +
  • productType - The IAPProductType (consumable, nonConsumable, nonRenewingSubscription or autoRenewableSubscription)
  • +
+ +

Example:

+ +

A good place is generally in your application delegate’s didFinishLaunchingWithOptions function, like below:

+
import InAppPurchaseLib
+
+class AppDelegate: UIResponder, UIApplicationDelegate, IAPPurchaseDelegate {
+  ...
+  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+    InAppPurchase.initialize(
+      iapProducts: [
+        IAPProduct(productIdentifier: "monthly_plan", productType: .autoRenewableSubscription),
+        IAPProduct(productIdentifier: "yearly_plan",  productType: .autoRenewableSubscription),
+        IAPProduct(productIdentifier: "disable_ads",  productType: .nonConsumable)
+      ],
+      validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678")
+  }
+
+  func productPurchased(productIdentifier: String) {
+    // ... process purchase (we'll see that later)
+  }
+}
+
+ +

You should also call the stop method when the application will terminate, for proper cleanup.

+
  func applicationWillTerminate(_ application: UIApplication) {
+    InAppPurchase.stop()
+  }
+
+ +

For more advanced use cases, in particular when you have implemented user login, you’ll have to make some adjustments. We’ll learn more about this in the Server integration section.

+ +

Tip: If initialization was successful, you should see a new receipt validation event in Fovea’s Dashboard.

+

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.

+ +

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).
  • +
+ +

Example:

+ +

You can add a function similar to this to your view.

+
@objc func refreshView() {
+  guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product_id") else {
+    self.titleLabel.text = "Product unavailable"
+    return
+  }
+  self.titleLabel.text = product.localizedTitle
+  self.descriptionLabel.text = product.localizedDescription
+  self.priceLabel.text = product.localizedPrice
+}
+
+ +

This example assumes self.titleLabel is a UILabel, etc.

+ +

Make sure to call this function when the view appears on screen, for instance by calling it from viewWillAppear.

+
override func viewWillAppear(_ animated: Bool) {
+  self.refreshView()
+}
+
+

Displaying subscriptions

+ +

For subscription products, you also have some data about subscription periods and introductory offers.

+ +
    +
  • func hasIntroductoryPriceEligible() -> Bool - The product has an introductory price the user is eligible to.
  • +
  • localizedSubscriptionPeriod: String? - The period of the subscription.
  • +
  • localizedIntroductoryPrice: String? - The cost of the introductory offer if available in the local currency.
  • +
  • localizedIntroductoryPeriod: String? - The subscription period of the introductory offer.
  • +
  • localizedIntroductoryDuration: String? - The duration of the introductory offer.
  • +
+ +

Example

+
@objc func refreshView() {
+  guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product_id") else {
+    self.titleLabel.text = "Product unavailable"
+    return
+  }
+  self.titleLabel.text = product.localizedTitle
+  self.descriptionLabel.text = product.localizedDescription
+
+  // Format price text. Example: "0,99€ / month for 3 months (then 3,99 € / month)"
+  var priceText = "\(product.localizedPrice) / \(product.localizedSubscriptionPeriod!)"
+  if product.hasIntroductoryPriceEligible() {
+      if product.introductoryPrice!.numberOfPeriods == 1 {
+          priceText = "\(product.localizedIntroductoryPrice!) for \(product.localizedIntroductoryDuration!)" +
+          " (then \(priceText))"
+      } else {
+          priceText = "\(product.localizedIntroductoryPrice!) / \(product.localizedIntroductoryPeriod!)" +
+          " for \(product.localizedIntroductoryDuration!) (then \(priceText))"
+      }
+  }
+  self.priceLabel.text = priceText
+}
+
+ +

Note: You have to import StoreKit wherever you use SKProduct.

+

Refreshing

+ +

Data might change or not be yet available when your “product” view is presented. In order to properly handle those cases, you should refresh your view after refreshing in-app products metadata. You want to be sure you’re displaying up-to-date information.

+ +

To achieve this, call InAppPurchase.refresh() when your view is presented.

+
override func viewWillAppear(_ animated: Bool) {
+  self.refreshView()
+  InAppPurchase.refresh(callback: { _ in
+      self.refreshView()
+  })
+}
+
+

Purchasing

+ +

The purchase process is generally a little bit more involving than most people would expect. Why is it not just: purchase → on success unlock the feature?

+ +

Several reasons:

+ +
    +
  • In-app purchases can be initiated outside the app
  • +
  • In-app purchases can be deferred, pending parental approval
  • +
  • Apple wants to be sure you delivered the product before charging the user
  • +
+ +

That is why the process looks like so:

+ +
    +
  • being ready to handle purchase events from app startup
  • +
  • finalizing transactions when product delivery is complete
  • +
  • sending purchase request, for which successful doesn’t always mean complete
  • +
+

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.

+ +

Important: Do not process the purchase here, we’ll handle that later!

+ +

From this callback, you can for example unlock the UI by hiding your loading indicator and display a message to the user.

+ +

Example:

+
self.loaderView.show()
+InAppPurchase.purchase(
+  productIdentifier: "my_product_id",
+  callback: { _ in
+    self.loaderView.hide()
+})
+
+ +

This simple example locks the UI with a loader when the purchase is in progress. We’ll see later how the purchase has to be processed by your applicaiton.

+ +

The callback also gives more information about the outcome of the purchase, you might want to use it to update your UI as well. Note that some events are useful for analytics. So here’s a more complete example.

+
self.loaderView.show()
+InAppPurchase.purchase(
+  productIdentifier: "my_product_id",
+  callback: { result in
+    self.loaderView.hide()
+
+    switch result.state {
+    case .purchased:
+      // Product successfully purchased
+      // Reminder: Do not process the purchase here, only update your UI.
+      //           that's why we do not send data to analytics.
+      openThankYouScreen()
+    case .failed:
+      // Purchase failed
+      // - Human formated reason can be found in result.localizedDescription
+      // - More details in either result.skError or result.iapError
+      showError(result.localizedDescription)
+    case .deferred:
+      // The purchase is deferred, waiting for the parent's approval
+      openWaitingParentApprovalScreen()
+    case .cancelled:
+      // The user canceled the request, generally only useful for analytics.
+  }
+})
+
+ +

If the purchase fails, result will contain either .skError, a SKError from StoreKit, or .iapError, an IAPError.

+ +

Tip: After a successful purchase, you should see a new transaction in Fovea’s dashboard.

+

Handling purchases

+ +

Finally, the magic happened: a user purchased one of your products! Let’s see how we handle the different types of products.

+

Non-Consumables

+ +

Wherever your app needs to know if a non-consumable product has been purchased, use InAppPurchase.hasActivePurchase(for: +productIdentifier). This will return true if the user currently owns the product.

+ +

Note: The last known state for the user’s purchases is stored as UserDefaults. As such, their status is always available to your app, even when offline.

+ +

If you have a server that needs to know about the purchase. You should rely on Fovea’s webhook instead of doing anything in here. We will see that later in the Server integration section.

+

Auto-Renewable Subscriptions

+ +

As with non-consumables, you will use InAppPurchase.hasActivePurchase(for: productIdentifier) to check if the user is an active subscriber to a given product.

+ +

You might also like to call refresh regularly, for example when entering your main view. When appropriate, the library will refresh the receipt to detect subscription renewals or expiry.

+ +

As we’ve seend in the Refreshing section:

+
override func viewWillAppear(_ animated: Bool) {
+  self.refreshView()
+  InAppPurchase.refresh(callback: { _ in
+      self.refreshView()
+  })
+}
+
+ +

Note: Don’t be reluctant to call refresh() often. Internally, the library ensures heavy operation are only performed if necessary: for example when a subscription just expired. So in 99% of cases this call will result in no-operations.

+

Consumables

+ +

If the purchased products in a consumable, your app is responsible for delivering the purchase then acknowlege that you’ve done so. Delivering generally consists in increasing a counter for some sort of virtual currency.

+ +

Your app can be notified of a purchase at any time. So the library asks you to provide an IAPPurchaseDelegate from initialization.

+ +

In InAppPurchase.initialize(), we can pass an IAPPurchaseDelegate instance. This object implements the productPurchased(productIdentifier:) function, which is called whenever a purchase is approved.

+ +

Here’s a example implementation:

+
class AppDelegate: UIResponder, UIApplicationDelegate, IAPPurchaseDelegate {
+  ...
+  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+    InAppPurchase.initialize(
+      iapProducts: [...],
+      iapPurchaseDelegate: self, // ADDED: iapPurchaseDelegate
+      validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678")
+  }
+
+  // IAPPurchaseDelegate implementation
+  func productPurchased(productIdentifier: String) {
+    // TODO
+  }
+}
+
+ +

It’s also important to know that when a purchase is approved, money isn’t yet to reach your bank account. You have to acknowledge delivery of the (virtual) item to finalize the transaction. That is why we have to call InAppPurchase.finishTransactions(for: productIdentifier) as soon as we delivered the product.

+ +

Example

+ +

Let’s define a class that adopts the IAPPurchaseDelegate protocol, it can very well be your application delegate.

+
func productPurchased(productIdentifier: String) {
+  switch productIdenfier {
+  case "10_silver":
+    addSilver(10)
+  case "100_silver":
+    addSilver(100)
+  }
+  InAppPurchase.finishTransactions(for: productIdentifier)
+  Analytics.trackEvent("purchase succeeded", productIdentifier)
+}
+
+ +

Here, we implement our own unlocking logic and call InAppPurchase.finishTransactions() afterward (assuming addSilver is synchronous).

+ +

Note: productPurchased is called when a purchase has been confirmed by Fovea’s receipt validator. If you have a server, he probably already has been notified of this purchase using the webhook.

+ +

Reminder: Keep in mind that purchase notifications might occur even if you never called the InAppPurchase.purchase() function: purchases can be made from another device or the AppStore, they can be approved by parents when the app isn’t running, purchase flows can be interupted, etc. The pattern above ensures your app is always ready to handle purchase events.

+

Non-Renewing Subscriptions

+ +

For non-renewing subscriptions, delivering consists in increasing the amount of time a user can access a given feature. Apple doesn’t manage the length and expiry of non-renewing subscriptions: you have to do this yourself, as for consumables.

+ +

Basically, everything is identical to consumables.

+

Restoring purchases

+ +

Except if you only sell consumable products, Apple requires that you provide a “Restore Purchases” button to your users. In general, it is found in your application settings.

+ +

Call this method when this button is pressed.

+
@IBAction func restorePurchases(_ sender: Any) {
+  self.loaderView.show()
+  InAppPurchase.restorePurchases(callback: { result in
+      self.loaderView.hide()
+      switch result.state {
+      case .succeeded:
+          if result.addedPurchases > 0 {
+              print("Restore purchases successful.")
+          } else {
+              print("No purchase to restore.")
+          }
+      case .failed:
+          print("Restore purchases failed.")
+      }
+  })
+}
+
+ +

The callback method is called once the operation is complete. You can use it to unlock the UI, by hiding your loader for example, and display the adapted message to the user.

+

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

+ +

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

+ +

Apple’s Ask to Buy feature lets parents approve any purchases initiated by children, including in-app purchases.

+ +

With Ask to Buy enabled, when a child requests to make a purchase, the app is notified that the purchase is awaiting the parent’s approval in the purchase callback:

+
InAppPurchase.purchase(
+  productIdentifier: productIdentifier,
+  callback: { result in
+    switch result.state {
+    case .deferred:
+      // Pending parent approval
+  }
+})
+
+ +

In the deferred case, the child has been notified by StoreKit that the parents have to approve the purchase. He might then close the app and come back later. You don’t have much to do, but to display in your UI that there is a purchase waiting for parental approval in your views.

+ +

We will use the hasDeferredTransaction method:

+
InAppPurchase.hasDeferredTransaction(for productIdentifier: String) -> Bool
+
+

Example

+ +

Here’s an example that covers what has been discussed above. We will update our example refreshView function from before:

+
@objc func refreshView() {
+  guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product_id") else {
+    self.titleLabel.text = "Product unavailable"
+    return
+  }
+  self.titleLabel.text = product.localizedTitle
+  // ...
+
+  // "Ask to Buy" deferred purchase waiting for parent's approval
+  if InAppPurchase.hasDeferredTransaction(for: "my_product_id") {
+    self.statusLabel.text = "Waiting for Approval..."
+    self.purchaseButton.isPointerInteractionEnabled = false
+  }
+  // "Owned" product
+  else if InAppPurchase.hasActivePurchase(for: "my_product_id") {
+    self.statusLabel.text = "OWNED"
+    self.purchaseButton.isPointerInteractionEnabled = false
+  }
+  else {
+    self.purchaseButton.isPointerInteractionEnabled = true
+  }
+}
+
+ +

When a product is owned or has a deferred purchase, we make sure the purchase button is grayed out. We also use a status label to display some details. Of course, you are free to design your UI as you see fit.

+

Errors

+ +

When calling refresh(), purchase() or restorePurchases(), the callback can return an IAPError if the state is failed. +Here is the list of IAPErrorCode you can receive:

+ +
    +
  • Errors returned by refresh(), purchase() or restorePurchases()

    + +
      +
    • libraryNotInitialized - You must call the initialize fuction before using the library.
    • +
    • bundleIdentifierInvalid - The Bundle Identifier is invalid.
    • +
    • validatorUrlInvalid - The Validator URL String is invalid.
    • +
    • refreshReceiptFailed - Failed to refresh the App Store receipt.
    • +
    • validateReceiptFailed - Failed to validate the App Store receipt with Fovea.
    • +
    • readReceiptFailed - Failed to read the receipt validation.
    • +
  • +
  • Errors returned by refresh()

    + +
      +
    • refreshProductsFailed - Failed to refresh products from the App Store.
    • +
  • +
  • Errors returned by purchase()

    + +
      +
    • productNotFound - The product was not found on the App Store and cannot be purchased.
    • +
    • cannotMakePurchase - The user is not allowed to authorize payments.
    • +
    • alreadyPurchasing - A purchase is already in progress.
    • +
  • +
+

Analytics

+ +

Tracking the purchase flow is a common things in apps. Especially as it’s core to your revenue model.

+ +

We can track 5 events, which step in the purchase pipeline a user reached.

+ +
    +
  1. purchase initiated
  2. +
  3. purchase cancelled
  4. +
  5. purchase failed
  6. +
  7. purchase deferred
  8. +
  9. purchase succeeded
  10. +
+ +

Here’s a quick example showing how to implement this correctly.

+
func makePurchase() {
+  Analytics.trackEvent("purchase initiated")
+  InAppPurchase.purchase(
+    productIdentifier: "my_product_id",
+    callback: { result in
+      switch result.state {
+      case .purchased:
+        // Reminder: We are not processing the purchase here, only updating your UI.
+        //           That's why we do not send an event to analytics.
+      case .failed:
+        Analytics.trackEvent("purchase failed")
+      case .deferred:
+        Analytics.trackEvent("purchase deferred")
+      case .cancelled:
+        Analytics.trackEvent("purchase cancelled")
+    }
+  })
+}
+
+// IAPPurchaseDelegate implementation
+func productPurchased(productIdentifier: String) {
+  Analytics.trackEvent("purchase succeeded")
+  InAppPurchase.finishTransactions(for: productIdentifier)
+}
+
+ +

The important part to remember is that a purchase can occur outside your app (or be approved when the app is not running), that’s why tracking purchase succeeded has to be part of the productPurchased delegate function.

+ +

Refer to the Consumables section to learn more about the productPurchased function.

+

Server integration

+ +

In more advanced use cases, you have a server component. Users are logged in and you’ll like to unlock the content for this user on your server. The safest approach is to setup a Webhook on Fovea. You’ll receive notifications from Fovea that transaction have been processed and/or subscriptions updated.

+ +

The information sent from Fovea has been verified from Apple’s server, which makes it way more trustable than information sent from your app itself.

+ +

To take advantage of this, you have to inform the library of your application username. This applicationUsername can be provided as a parameter of the InAppPurchase.initialize method and updated later by changing the associated property.

+ +

Example:

+
InAppPurchase.initialize(
+  iapProducts: [...],
+  validatorUrlString: "..."),
+  applicationUsername: UserSession.getUserId())
+
+// later ...
+InAppPurchase.applicationUsername = UserSession.getUserId()
+
+ +

If a user account is mandatory in your app, you will want to delay calls to InAppPurchase.initialize() to when your user’s session is ready.

+ +

Do not hesitate to contact Fovea for help.

+

Xcode Demo Project

+ +

Do not hesitate to check the demo project available on here: iap-swift-lib-demo.

+

References

+ + +

Coding

+ +

Generate the documentation, using this fork of swift-doc (on --minimum-access-level is part of the main distrib).

+
swift-doc generate sources --module-name InAppPurchase --format html --output docs --minimum-access-level public --base-url /iap-swift-lib/
+
+

Troubleshooting

+ +

Common issues are covered here: https://github.com/iridescent-dev/iap-swift-lib/wiki/Troubleshooting

+

License

+ +

InAppPurchaseLib is open-sourced library licensed under the MIT License. See LICENSE for details.

+ +
+
+ +
+
+ + + diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/js/jazzy.js b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 0000000..1e55d6e --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,70 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targetted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/js/jquery.min.js b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100644 index 0000000..a1c07fd --- /dev/null +++ b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0Undocumented

"},"Typealiases.html#/s:16InAppPurchaseLib18IAPRefreshCallbacka":{"name":"IAPRefreshCallback","abstract":"

Undocumented

"},"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"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV4codeAA0E4CodeOvp":{"name":"code","abstract":"

Undocumented

","parent_name":"IAPError"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV20localizedDescriptionSSvp":{"name":"localizedDescription","abstract":"

Undocumented

","parent_name":"IAPError"},"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"},"Structs/IAPPurchaseResult.html":{"name":"IAPPurchaseResult","abstract":"

Undocumented

"},"Structs/IAPRefreshResult.html":{"name":"IAPRefreshResult","abstract":"

Undocumented

"},"Structs/IAPError.html":{"name":"IAPError","abstract":"

Undocumented

"},"Structs/IAPProduct.html":{"name":"IAPProduct","abstract":"

Undocumented

"},"Protocols/IAPPurchaseDelegate.html#/s:16InAppPurchaseLib19IAPPurchaseDelegateP16productPurchased0G10IdentifierySS_tF":{"name":"productPurchased(productIdentifier:)","abstract":"

Called when a product is newly purchased, updated or restored.

","parent_name":"IAPPurchaseDelegate"},"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"},"Protocols/IAPErrorProtocol.html#/s:16InAppPurchaseLib16IAPErrorProtocolP4codeAA0E4CodeOvp":{"name":"code","abstract":"

Undocumented

","parent_name":"IAPErrorProtocol"},"Protocols/IAPErrorProtocol.html":{"name":"IAPErrorProtocol","abstract":"

Undocumented

"},"Protocols/InAppPurchaseLib.html":{"name":"InAppPurchaseLib","abstract":"

The protocol that InAppPurchase` adopts.

"},"Protocols/IAPPurchaseDelegate.html":{"name":"IAPPurchaseDelegate","abstract":"

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

"},"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"},"Extensions/SKProduct.html":{"name":"SKProduct"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO5shortyA2CmF":{"name":"short","abstract":"

Undocumented

","parent_name":"IAPPeriodFormat"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO4longyA2CmF":{"name":"long","abstract":"

Undocumented

","parent_name":"IAPPeriodFormat"},"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"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21libraryNotInitializedyA2CmF":{"name":"libraryNotInitialized","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO15productNotFoundyA2CmF":{"name":"productNotFound","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO010cannotMakeC0yA2CmF":{"name":"cannotMakePurchase","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17alreadyPurchasingyA2CmF":{"name":"alreadyPurchasing","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO23bundleIdentifierInvalidyA2CmF":{"name":"bundleIdentifierInvalid","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO19validatorUrlInvalidyA2CmF":{"name":"validatorUrlInvalid","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO20refreshReceiptFailedyA2CmF":{"name":"refreshReceiptFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21validateReceiptFailedyA2CmF":{"name":"validateReceiptFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17readReceiptFailedyA2CmF":{"name":"readReceiptFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21refreshProductsFailedyA2CmF":{"name":"refreshProductsFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO9succeededyA2CmF":{"name":"succeeded","abstract":"

Undocumented

","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO6failedyA2CmF":{"name":"failed","abstract":"

Undocumented

","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO7skippedyA2CmF":{"name":"skipped","abstract":"

Undocumented

","parent_name":"IAPRefreshResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9purchasedyA2CmF":{"name":"purchased","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO6failedyA2CmF":{"name":"failed","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9cancelledyA2CmF":{"name":"cancelled","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO8deferredyA2CmF":{"name":"deferred","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html":{"name":"IAPPurchaseResultState","abstract":"

Undocumented

"},"Enums/IAPRefreshResultState.html":{"name":"IAPRefreshResultState","abstract":"

Undocumented

"},"Enums/IAPErrorCode.html":{"name":"IAPErrorCode","abstract":"

Undocumented

"},"Enums/IAPProductType.html":{"name":"IAPProductType","abstract":"

Undocumented

"},"Enums/IAPPeriodFormat.html":{"name":"IAPPeriodFormat","abstract":"

Undocumented

"},"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"},"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":"

Undocumented

"},"Classes/DefaultPurchaseDelegate.html":{"name":"DefaultPurchaseDelegate","abstract":"

The default implementation of IAPPurchaseDelegate if no other is provided.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"},"Typealiases.html":{"name":"Type Aliases","abstract":"

The following type aliases are available globally.

"}} \ No newline at end of file diff --git a/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/docSet.dsidx b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/docSet.dsidx new file mode 100644 index 0000000..cf3069f Binary files /dev/null and b/docs/jazzy/docsets/InAppPurchaseLib.docset/Contents/Resources/docSet.dsidx differ diff --git a/docs/jazzy/docsets/InAppPurchaseLib.tgz b/docs/jazzy/docsets/InAppPurchaseLib.tgz new file mode 100644 index 0000000..1579f81 Binary files /dev/null and b/docs/jazzy/docsets/InAppPurchaseLib.tgz differ diff --git a/docs/jazzy/img/carat.png b/docs/jazzy/img/carat.png new file mode 100755 index 0000000..29d2f7f Binary files /dev/null and b/docs/jazzy/img/carat.png differ diff --git a/docs/jazzy/img/dash.png b/docs/jazzy/img/dash.png new file mode 100755 index 0000000..6f694c7 Binary files /dev/null and b/docs/jazzy/img/dash.png differ diff --git a/docs/jazzy/img/gh.png b/docs/jazzy/img/gh.png new file mode 100755 index 0000000..628da97 Binary files /dev/null and b/docs/jazzy/img/gh.png differ diff --git a/docs/jazzy/index.html b/docs/jazzy/index.html new file mode 100644 index 0000000..e633951 --- /dev/null +++ b/docs/jazzy/index.html @@ -0,0 +1,699 @@ + + + + InAppPurchaseLib Reference + + + + + + + + + +
+
+

InAppPurchaseLib (52% documented)

+

View on GitHub

+
+
+
+ +
+
+ +
+
+
+ +

+ +

+ +
+

An easy-to-use library for In-App Purchases, using Fovea.Billing for receipts validation.

+
+ + +

Features

+ +
    +
  • ✅ Purchase a product
  • +
  • ✅ Restore purchased products
  • +
  • ✅ Verify transactions with the App Store on Fovea.Billing server
  • +
  • ✅ Handle and notify payment transaction states
  • +
  • ✅ Retreive products information from the App Store
  • +
  • ✅ Support all product types (consumable, non-consumable, auto-renewable subscription, non-renewing subscription)
  • +
  • ✅ Status of purchases available when offline
  • +
  • ✅ Server integration with a Webhook
  • +
+

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

+ +

+ +

+ +
    +
  • Select your project in Xcode
  • +
  • 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
  • +
  • Make sure your project is selected in Add to target
  • +
  • Click on Finish
  • +
+ +

Note: You have to import InAppPurchaseLib wherever you use the library.

+

Usage

+ +

The process of implementing in-app purchases involves several steps:

+ +
    +
  1. Displaying the list of purchasable products
  2. +
  3. Initiating a purchase
  4. +
  5. Delivering and finalizing a purchase
  6. +
  7. Checking the current ownership of non-consumables and subscriptions
  8. +
  9. Implementing the Restore Purchases button
  10. +
+

Initialization

+ +

Before everything else the library must be initialized. This has to happen as soon as possible. A good way is to call the InAppPurchase.initialize() method when the application did finish launching. In the background, this will load your products and refresh the status of purchases and subscriptions.

+ +

InAppPurchase.initialize() accepts the following arguments:

+ +
    +
  • iapProducts - An array of IAPProduct (REQUIRED)
  • +
  • validatorUrlString - The validator url retrieved from Fovea (REQUIRED)
  • +
  • applicationUsername - The user name, if your app implements user login (optional)
  • +
+ +

Each IAPProduct contains the following fields:

+ +
    +
  • productIdentifier - The product unique identifier
  • +
  • productType - The IAPProductType (consumable, nonConsumable, nonRenewingSubscription or autoRenewableSubscription)
  • +
+ +

Example:

+ +

A good place is generally in your application delegate’s didFinishLaunchingWithOptions function, like below:

+
import InAppPurchaseLib
+
+class AppDelegate: UIResponder, UIApplicationDelegate, IAPPurchaseDelegate {
+  ...
+  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+    InAppPurchase.initialize(
+      iapProducts: [
+        IAPProduct(productIdentifier: "monthly_plan", productType: .autoRenewableSubscription),
+        IAPProduct(productIdentifier: "yearly_plan",  productType: .autoRenewableSubscription),
+        IAPProduct(productIdentifier: "disable_ads",  productType: .nonConsumable)
+      ],
+      validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678")
+  }
+
+  func productPurchased(productIdentifier: String) {
+    // ... process purchase (we'll see that later)
+  }
+}
+
+ +

You should also call the stop method when the application will terminate, for proper cleanup.

+
  func applicationWillTerminate(_ application: UIApplication) {
+    InAppPurchase.stop()
+  }
+
+ +

For more advanced use cases, in particular when you have implemented user login, you’ll have to make some adjustments. We’ll learn more about this in the Server integration section.

+ +

Tip: If initialization was successful, you should see a new receipt validation event in Fovea’s Dashboard.

+

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.

+ +

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).
  • +
+ +

Example:

+ +

You can add a function similar to this to your view.

+
@objc func refreshView() {
+  guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product_id") else {
+    self.titleLabel.text = "Product unavailable"
+    return
+  }
+  self.titleLabel.text = product.localizedTitle
+  self.descriptionLabel.text = product.localizedDescription
+  self.priceLabel.text = product.localizedPrice
+}
+
+ +

This example assumes self.titleLabel is a UILabel, etc.

+ +

Make sure to call this function when the view appears on screen, for instance by calling it from viewWillAppear.

+
override func viewWillAppear(_ animated: Bool) {
+  self.refreshView()
+}
+
+

Displaying subscriptions

+ +

For subscription products, you also have some data about subscription periods and introductory offers.

+ +
    +
  • func hasIntroductoryPriceEligible() -> Bool - The product has an introductory price the user is eligible to.
  • +
  • localizedSubscriptionPeriod: String? - The period of the subscription.
  • +
  • localizedIntroductoryPrice: String? - The cost of the introductory offer if available in the local currency.
  • +
  • localizedIntroductoryPeriod: String? - The subscription period of the introductory offer.
  • +
  • localizedIntroductoryDuration: String? - The duration of the introductory offer.
  • +
+ +

Example

+
@objc func refreshView() {
+  guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product_id") else {
+    self.titleLabel.text = "Product unavailable"
+    return
+  }
+  self.titleLabel.text = product.localizedTitle
+  self.descriptionLabel.text = product.localizedDescription
+
+  // Format price text. Example: "0,99€ / month for 3 months (then 3,99 € / month)"
+  var priceText = "\(product.localizedPrice) / \(product.localizedSubscriptionPeriod!)"
+  if product.hasIntroductoryPriceEligible() {
+      if product.introductoryPrice!.numberOfPeriods == 1 {
+          priceText = "\(product.localizedIntroductoryPrice!) for \(product.localizedIntroductoryDuration!)" +
+          " (then \(priceText))"
+      } else {
+          priceText = "\(product.localizedIntroductoryPrice!) / \(product.localizedIntroductoryPeriod!)" +
+          " for \(product.localizedIntroductoryDuration!) (then \(priceText))"
+      }
+  }
+  self.priceLabel.text = priceText
+}
+
+ +

Note: You have to import StoreKit wherever you use SKProduct.

+

Refreshing

+ +

Data might change or not be yet available when your “product” view is presented. In order to properly handle those cases, you should refresh your view after refreshing in-app products metadata. You want to be sure you’re displaying up-to-date information.

+ +

To achieve this, call InAppPurchase.refresh() when your view is presented.

+
override func viewWillAppear(_ animated: Bool) {
+  self.refreshView()
+  InAppPurchase.refresh(callback: { _ in
+      self.refreshView()
+  })
+}
+
+

Purchasing

+ +

The purchase process is generally a little bit more involving than most people would expect. Why is it not just: purchase → on success unlock the feature?

+ +

Several reasons:

+ +
    +
  • In-app purchases can be initiated outside the app
  • +
  • In-app purchases can be deferred, pending parental approval
  • +
  • Apple wants to be sure you delivered the product before charging the user
  • +
+ +

That is why the process looks like so:

+ +
    +
  • being ready to handle purchase events from app startup
  • +
  • finalizing transactions when product delivery is complete
  • +
  • sending purchase request, for which successful doesn’t always mean complete
  • +
+

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.

+ +

Important: Do not process the purchase here, we’ll handle that later!

+ +

From this callback, you can for example unlock the UI by hiding your loading indicator and display a message to the user.

+ +

Example:

+
self.loaderView.show()
+InAppPurchase.purchase(
+  productIdentifier: "my_product_id",
+  callback: { _ in
+    self.loaderView.hide()
+})
+
+ +

This simple example locks the UI with a loader when the purchase is in progress. We’ll see later how the purchase has to be processed by your applicaiton.

+ +

The callback also gives more information about the outcome of the purchase, you might want to use it to update your UI as well. Note that some events are useful for analytics. So here’s a more complete example.

+
self.loaderView.show()
+InAppPurchase.purchase(
+  productIdentifier: "my_product_id",
+  callback: { result in
+    self.loaderView.hide()
+
+    switch result.state {
+    case .purchased:
+      // Product successfully purchased
+      // Reminder: Do not process the purchase here, only update your UI.
+      //           that's why we do not send data to analytics.
+      openThankYouScreen()
+    case .failed:
+      // Purchase failed
+      // - Human formated reason can be found in result.localizedDescription
+      // - More details in either result.skError or result.iapError
+      showError(result.localizedDescription)
+    case .deferred:
+      // The purchase is deferred, waiting for the parent's approval
+      openWaitingParentApprovalScreen()
+    case .cancelled:
+      // The user canceled the request, generally only useful for analytics.
+  }
+})
+
+ +

If the purchase fails, result will contain either .skError, a SKError from StoreKit, or .iapError, an IAPError.

+ +

Tip: After a successful purchase, you should see a new transaction in Fovea’s dashboard.

+

Handling purchases

+ +

Finally, the magic happened: a user purchased one of your products! Let’s see how we handle the different types of products.

+

Non-Consumables

+ +

Wherever your app needs to know if a non-consumable product has been purchased, use InAppPurchase.hasActivePurchase(for: +productIdentifier). This will return true if the user currently owns the product.

+ +

Note: The last known state for the user’s purchases is stored as UserDefaults. As such, their status is always available to your app, even when offline.

+ +

If you have a server that needs to know about the purchase. You should rely on Fovea’s webhook instead of doing anything in here. We will see that later in the Server integration section.

+

Auto-Renewable Subscriptions

+ +

As with non-consumables, you will use InAppPurchase.hasActivePurchase(for: productIdentifier) to check if the user is an active subscriber to a given product.

+ +

You might also like to call refresh regularly, for example when entering your main view. When appropriate, the library will refresh the receipt to detect subscription renewals or expiry.

+ +

As we’ve seend in the Refreshing section:

+
override func viewWillAppear(_ animated: Bool) {
+  self.refreshView()
+  InAppPurchase.refresh(callback: { _ in
+      self.refreshView()
+  })
+}
+
+ +

Note: Don’t be reluctant to call refresh() often. Internally, the library ensures heavy operation are only performed if necessary: for example when a subscription just expired. So in 99% of cases this call will result in no-operations.

+

Consumables

+ +

If the purchased products in a consumable, your app is responsible for delivering the purchase then acknowlege that you’ve done so. Delivering generally consists in increasing a counter for some sort of virtual currency.

+ +

Your app can be notified of a purchase at any time. So the library asks you to provide an IAPPurchaseDelegate from initialization.

+ +

In InAppPurchase.initialize(), we can pass an IAPPurchaseDelegate instance. This object implements the productPurchased(productIdentifier:) function, which is called whenever a purchase is approved.

+ +

Here’s a example implementation:

+
class AppDelegate: UIResponder, UIApplicationDelegate, IAPPurchaseDelegate {
+  ...
+  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+    InAppPurchase.initialize(
+      iapProducts: [...],
+      iapPurchaseDelegate: self, // ADDED: iapPurchaseDelegate
+      validatorUrlString: "https://validator.fovea.cc/v1/validate?appName=demo&apiKey=12345678")
+  }
+
+  // IAPPurchaseDelegate implementation
+  func productPurchased(productIdentifier: String) {
+    // TODO
+  }
+}
+
+ +

It’s also important to know that when a purchase is approved, money isn’t yet to reach your bank account. You have to acknowledge delivery of the (virtual) item to finalize the transaction. That is why we have to call InAppPurchase.finishTransactions(for: productIdentifier) as soon as we delivered the product.

+ +

Example

+ +

Let’s define a class that adopts the IAPPurchaseDelegate protocol, it can very well be your application delegate.

+
func productPurchased(productIdentifier: String) {
+  switch productIdenfier {
+  case "10_silver":
+    addSilver(10)
+  case "100_silver":
+    addSilver(100)
+  }
+  InAppPurchase.finishTransactions(for: productIdentifier)
+  Analytics.trackEvent("purchase succeeded", productIdentifier)
+}
+
+ +

Here, we implement our own unlocking logic and call InAppPurchase.finishTransactions() afterward (assuming addSilver is synchronous).

+ +

Note: productPurchased is called when a purchase has been confirmed by Fovea’s receipt validator. If you have a server, he probably already has been notified of this purchase using the webhook.

+ +

Reminder: Keep in mind that purchase notifications might occur even if you never called the InAppPurchase.purchase() function: purchases can be made from another device or the AppStore, they can be approved by parents when the app isn’t running, purchase flows can be interupted, etc. The pattern above ensures your app is always ready to handle purchase events.

+

Non-Renewing Subscriptions

+ +

For non-renewing subscriptions, delivering consists in increasing the amount of time a user can access a given feature. Apple doesn’t manage the length and expiry of non-renewing subscriptions: you have to do this yourself, as for consumables.

+ +

Basically, everything is identical to consumables.

+

Restoring purchases

+ +

Except if you only sell consumable products, Apple requires that you provide a “Restore Purchases” button to your users. In general, it is found in your application settings.

+ +

Call this method when this button is pressed.

+
@IBAction func restorePurchases(_ sender: Any) {
+  self.loaderView.show()
+  InAppPurchase.restorePurchases(callback: { result in
+      self.loaderView.hide()
+      switch result.state {
+      case .succeeded:
+          if result.addedPurchases > 0 {
+              print("Restore purchases successful.")
+          } else {
+              print("No purchase to restore.")
+          }
+      case .failed:
+          print("Restore purchases failed.")
+      }
+  })
+}
+
+ +

The callback method is called once the operation is complete. You can use it to unlock the UI, by hiding your loader for example, and display the adapted message to the user.

+

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

+ +

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

+ +

Apple’s Ask to Buy feature lets parents approve any purchases initiated by children, including in-app purchases.

+ +

With Ask to Buy enabled, when a child requests to make a purchase, the app is notified that the purchase is awaiting the parent’s approval in the purchase callback:

+
InAppPurchase.purchase(
+  productIdentifier: productIdentifier,
+  callback: { result in
+    switch result.state {
+    case .deferred:
+      // Pending parent approval
+  }
+})
+
+ +

In the deferred case, the child has been notified by StoreKit that the parents have to approve the purchase. He might then close the app and come back later. You don’t have much to do, but to display in your UI that there is a purchase waiting for parental approval in your views.

+ +

We will use the hasDeferredTransaction method:

+
InAppPurchase.hasDeferredTransaction(for productIdentifier: String) -> Bool
+
+

Example

+ +

Here’s an example that covers what has been discussed above. We will update our example refreshView function from before:

+
@objc func refreshView() {
+  guard let product: SKProduct = InAppPurchase.getProductBy(identifier: "my_product_id") else {
+    self.titleLabel.text = "Product unavailable"
+    return
+  }
+  self.titleLabel.text = product.localizedTitle
+  // ...
+
+  // "Ask to Buy" deferred purchase waiting for parent's approval
+  if InAppPurchase.hasDeferredTransaction(for: "my_product_id") {
+    self.statusLabel.text = "Waiting for Approval..."
+    self.purchaseButton.isPointerInteractionEnabled = false
+  }
+  // "Owned" product
+  else if InAppPurchase.hasActivePurchase(for: "my_product_id") {
+    self.statusLabel.text = "OWNED"
+    self.purchaseButton.isPointerInteractionEnabled = false
+  }
+  else {
+    self.purchaseButton.isPointerInteractionEnabled = true
+  }
+}
+
+ +

When a product is owned or has a deferred purchase, we make sure the purchase button is grayed out. We also use a status label to display some details. Of course, you are free to design your UI as you see fit.

+

Errors

+ +

When calling refresh(), purchase() or restorePurchases(), the callback can return an IAPError if the state is failed. +Here is the list of IAPErrorCode you can receive:

+ +
    +
  • Errors returned by refresh(), purchase() or restorePurchases()

    + +
      +
    • libraryNotInitialized - You must call the initialize fuction before using the library.
    • +
    • bundleIdentifierInvalid - The Bundle Identifier is invalid.
    • +
    • validatorUrlInvalid - The Validator URL String is invalid.
    • +
    • refreshReceiptFailed - Failed to refresh the App Store receipt.
    • +
    • validateReceiptFailed - Failed to validate the App Store receipt with Fovea.
    • +
    • readReceiptFailed - Failed to read the receipt validation.
    • +
  • +
  • Errors returned by refresh()

    + +
      +
    • refreshProductsFailed - Failed to refresh products from the App Store.
    • +
  • +
  • Errors returned by purchase()

    + +
      +
    • productNotFound - The product was not found on the App Store and cannot be purchased.
    • +
    • cannotMakePurchase - The user is not allowed to authorize payments.
    • +
    • alreadyPurchasing - A purchase is already in progress.
    • +
  • +
+

Analytics

+ +

Tracking the purchase flow is a common things in apps. Especially as it’s core to your revenue model.

+ +

We can track 5 events, which step in the purchase pipeline a user reached.

+ +
    +
  1. purchase initiated
  2. +
  3. purchase cancelled
  4. +
  5. purchase failed
  6. +
  7. purchase deferred
  8. +
  9. purchase succeeded
  10. +
+ +

Here’s a quick example showing how to implement this correctly.

+
func makePurchase() {
+  Analytics.trackEvent("purchase initiated")
+  InAppPurchase.purchase(
+    productIdentifier: "my_product_id",
+    callback: { result in
+      switch result.state {
+      case .purchased:
+        // Reminder: We are not processing the purchase here, only updating your UI.
+        //           That's why we do not send an event to analytics.
+      case .failed:
+        Analytics.trackEvent("purchase failed")
+      case .deferred:
+        Analytics.trackEvent("purchase deferred")
+      case .cancelled:
+        Analytics.trackEvent("purchase cancelled")
+    }
+  })
+}
+
+// IAPPurchaseDelegate implementation
+func productPurchased(productIdentifier: String) {
+  Analytics.trackEvent("purchase succeeded")
+  InAppPurchase.finishTransactions(for: productIdentifier)
+}
+
+ +

The important part to remember is that a purchase can occur outside your app (or be approved when the app is not running), that’s why tracking purchase succeeded has to be part of the productPurchased delegate function.

+ +

Refer to the Consumables section to learn more about the productPurchased function.

+

Server integration

+ +

In more advanced use cases, you have a server component. Users are logged in and you’ll like to unlock the content for this user on your server. The safest approach is to setup a Webhook on Fovea. You’ll receive notifications from Fovea that transaction have been processed and/or subscriptions updated.

+ +

The information sent from Fovea has been verified from Apple’s server, which makes it way more trustable than information sent from your app itself.

+ +

To take advantage of this, you have to inform the library of your application username. This applicationUsername can be provided as a parameter of the InAppPurchase.initialize method and updated later by changing the associated property.

+ +

Example:

+
InAppPurchase.initialize(
+  iapProducts: [...],
+  validatorUrlString: "..."),
+  applicationUsername: UserSession.getUserId())
+
+// later ...
+InAppPurchase.applicationUsername = UserSession.getUserId()
+
+ +

If a user account is mandatory in your app, you will want to delay calls to InAppPurchase.initialize() to when your user’s session is ready.

+ +

Do not hesitate to contact Fovea for help.

+

Xcode Demo Project

+ +

Do not hesitate to check the demo project available on here: iap-swift-lib-demo.

+

References

+ + +

Coding

+ +

Generate the documentation, using this fork of swift-doc (on --minimum-access-level is part of the main distrib).

+
swift-doc generate sources --module-name InAppPurchase --format html --output docs --minimum-access-level public --base-url /iap-swift-lib/
+
+

Troubleshooting

+ +

Common issues are covered here: https://github.com/iridescent-dev/iap-swift-lib/wiki/Troubleshooting

+

License

+ +

InAppPurchaseLib is open-sourced library licensed under the MIT License. See LICENSE for details.

+ +
+
+ +
+
+ + + diff --git a/docs/jazzy/js/jazzy.js b/docs/jazzy/js/jazzy.js new file mode 100755 index 0000000..1e55d6e --- /dev/null +++ b/docs/jazzy/js/jazzy.js @@ -0,0 +1,70 @@ +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targetted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docs/jazzy/js/jquery.min.js b/docs/jazzy/js/jquery.min.js new file mode 100644 index 0000000..a1c07fd --- /dev/null +++ b/docs/jazzy/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0Undocumented

"},"Typealiases.html#/s:16InAppPurchaseLib18IAPRefreshCallbacka":{"name":"IAPRefreshCallback","abstract":"

Undocumented

"},"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"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV4codeAA0E4CodeOvp":{"name":"code","abstract":"

Undocumented

","parent_name":"IAPError"},"Structs/IAPError.html#/s:16InAppPurchaseLib8IAPErrorV20localizedDescriptionSSvp":{"name":"localizedDescription","abstract":"

Undocumented

","parent_name":"IAPError"},"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"},"Structs/IAPPurchaseResult.html":{"name":"IAPPurchaseResult","abstract":"

Undocumented

"},"Structs/IAPRefreshResult.html":{"name":"IAPRefreshResult","abstract":"

Undocumented

"},"Structs/IAPError.html":{"name":"IAPError","abstract":"

Undocumented

"},"Structs/IAPProduct.html":{"name":"IAPProduct","abstract":"

Undocumented

"},"Protocols/IAPPurchaseDelegate.html#/s:16InAppPurchaseLib19IAPPurchaseDelegateP16productPurchased0G10IdentifierySS_tF":{"name":"productPurchased(productIdentifier:)","abstract":"

Called when a product is newly purchased, updated or restored.

","parent_name":"IAPPurchaseDelegate"},"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"},"Protocols/IAPErrorProtocol.html#/s:16InAppPurchaseLib16IAPErrorProtocolP4codeAA0E4CodeOvp":{"name":"code","abstract":"

Undocumented

","parent_name":"IAPErrorProtocol"},"Protocols/IAPErrorProtocol.html":{"name":"IAPErrorProtocol","abstract":"

Undocumented

"},"Protocols/InAppPurchaseLib.html":{"name":"InAppPurchaseLib","abstract":"

The protocol that InAppPurchase` adopts.

"},"Protocols/IAPPurchaseDelegate.html":{"name":"IAPPurchaseDelegate","abstract":"

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

"},"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"},"Extensions/SKProduct.html":{"name":"SKProduct"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO5shortyA2CmF":{"name":"short","abstract":"

Undocumented

","parent_name":"IAPPeriodFormat"},"Enums/IAPPeriodFormat.html#/s:16InAppPurchaseLib15IAPPeriodFormatO4longyA2CmF":{"name":"long","abstract":"

Undocumented

","parent_name":"IAPPeriodFormat"},"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"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21libraryNotInitializedyA2CmF":{"name":"libraryNotInitialized","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO15productNotFoundyA2CmF":{"name":"productNotFound","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO010cannotMakeC0yA2CmF":{"name":"cannotMakePurchase","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17alreadyPurchasingyA2CmF":{"name":"alreadyPurchasing","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO23bundleIdentifierInvalidyA2CmF":{"name":"bundleIdentifierInvalid","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO19validatorUrlInvalidyA2CmF":{"name":"validatorUrlInvalid","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO20refreshReceiptFailedyA2CmF":{"name":"refreshReceiptFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21validateReceiptFailedyA2CmF":{"name":"validateReceiptFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO17readReceiptFailedyA2CmF":{"name":"readReceiptFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPErrorCode.html#/s:16InAppPurchaseLib12IAPErrorCodeO21refreshProductsFailedyA2CmF":{"name":"refreshProductsFailed","abstract":"

Undocumented

","parent_name":"IAPErrorCode"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO9succeededyA2CmF":{"name":"succeeded","abstract":"

Undocumented

","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO6failedyA2CmF":{"name":"failed","abstract":"

Undocumented

","parent_name":"IAPRefreshResultState"},"Enums/IAPRefreshResultState.html#/s:16InAppPurchaseLib21IAPRefreshResultStateO7skippedyA2CmF":{"name":"skipped","abstract":"

Undocumented

","parent_name":"IAPRefreshResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9purchasedyA2CmF":{"name":"purchased","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO6failedyA2CmF":{"name":"failed","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO9cancelledyA2CmF":{"name":"cancelled","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html#/s:16InAppPurchaseLib22IAPPurchaseResultStateO8deferredyA2CmF":{"name":"deferred","abstract":"

Undocumented

","parent_name":"IAPPurchaseResultState"},"Enums/IAPPurchaseResultState.html":{"name":"IAPPurchaseResultState","abstract":"

Undocumented

"},"Enums/IAPRefreshResultState.html":{"name":"IAPRefreshResultState","abstract":"

Undocumented

"},"Enums/IAPErrorCode.html":{"name":"IAPErrorCode","abstract":"

Undocumented

"},"Enums/IAPProductType.html":{"name":"IAPProductType","abstract":"

Undocumented

"},"Enums/IAPPeriodFormat.html":{"name":"IAPPeriodFormat","abstract":"

Undocumented

"},"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"},"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":"

Undocumented

"},"Classes/DefaultPurchaseDelegate.html":{"name":"DefaultPurchaseDelegate","abstract":"

The default implementation of IAPPurchaseDelegate if no other is provided.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"},"Typealiases.html":{"name":"Type Aliases","abstract":"

The following type aliases are available globally.

"}} \ No newline at end of file diff --git a/docs/jazzy/undocumented.json b/docs/jazzy/undocumented.json new file mode 100644 index 0000000..e44d55a --- /dev/null +++ b/docs/jazzy/undocumented.json @@ -0,0 +1,348 @@ +{ + "warnings": [ + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 12, + "symbol": "IAPPurchaseCallback", + "symbol_kind": "source.lang.swift.decl.typealias", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 13, + "symbol": "IAPPurchaseResult", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 14, + "symbol": "IAPPurchaseResult.state", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 15, + "symbol": "IAPPurchaseResult.iapError", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 16, + "symbol": "IAPPurchaseResult.skError", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 18, + "symbol": "IAPPurchaseResult.localizedDescription", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 25, + "symbol": "IAPPurchaseResultState", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 26, + "symbol": "IAPPurchaseResultState.purchased", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 27, + "symbol": "IAPPurchaseResultState.failed", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 28, + "symbol": "IAPPurchaseResultState.cancelled", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 29, + "symbol": "IAPPurchaseResultState.deferred", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 33, + "symbol": "IAPRefreshCallback", + "symbol_kind": "source.lang.swift.decl.typealias", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 34, + "symbol": "IAPRefreshResult", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 35, + "symbol": "IAPRefreshResult.state", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 36, + "symbol": "IAPRefreshResult.iapError", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 37, + "symbol": "IAPRefreshResult.addedPurchases", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 38, + "symbol": "IAPRefreshResult.updatedPurchases", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 41, + "symbol": "IAPRefreshResultState", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 42, + "symbol": "IAPRefreshResultState.succeeded", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 43, + "symbol": "IAPRefreshResultState.failed", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPCallback.swift", + "line": 44, + "symbol": "IAPRefreshResultState.skipped", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 11, + "symbol": "IAPErrorProtocol", + "symbol_kind": "source.lang.swift.decl.protocol", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 12, + "symbol": "IAPErrorProtocol.code", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 15, + "symbol": "IAPErrorCode", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 16, + "symbol": "IAPErrorCode.libraryNotInitialized", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 17, + "symbol": "IAPErrorCode.productNotFound", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 18, + "symbol": "IAPErrorCode.cannotMakePurchase", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 19, + "symbol": "IAPErrorCode.alreadyPurchasing", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 21, + "symbol": "IAPErrorCode.bundleIdentifierInvalid", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 22, + "symbol": "IAPErrorCode.validatorUrlInvalid", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 23, + "symbol": "IAPErrorCode.refreshReceiptFailed", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 24, + "symbol": "IAPErrorCode.validateReceiptFailed", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 25, + "symbol": "IAPErrorCode.readReceiptFailed", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 27, + "symbol": "IAPErrorCode.refreshProductsFailed", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 30, + "symbol": "IAPError", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 31, + "symbol": "IAPError.code", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Common/IAPError.swift", + "line": 32, + "symbol": "IAPError.localizedDescription", + "symbol_kind": "source.lang.swift.decl.var.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/InAppPurchase.swift", + "line": 12, + "symbol": "InAppPurchase", + "symbol_kind": "source.lang.swift.decl.class", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/InAppPurchaseLib.swift", + "line": 132, + "symbol": "DefaultPurchaseDelegate.init()", + "symbol_kind": "source.lang.swift.decl.function.method.instance", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/IAPProduct.swift", + "line": 11, + "symbol": "IAPProduct", + "symbol_kind": "source.lang.swift.decl.struct", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/IAPProduct.swift", + "line": 31, + "symbol": "IAPProductType", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/IAPProduct.swift", + "line": 32, + "symbol": "IAPProductType.consumable", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/IAPProduct.swift", + "line": 33, + "symbol": "IAPProductType.nonConsumable", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/IAPProduct.swift", + "line": 34, + "symbol": "IAPProductType.nonRenewingSubscription", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/IAPProduct.swift", + "line": 35, + "symbol": "IAPProductType.autoRenewableSubscription", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/SKProductExtension.swift", + "line": 12, + "symbol": "IAPPeriodFormat", + "symbol_kind": "source.lang.swift.decl.enum", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/SKProductExtension.swift", + "line": 13, + "symbol": "IAPPeriodFormat.short", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/SKProductExtension.swift", + "line": 14, + "symbol": "IAPPeriodFormat.long", + "symbol_kind": "source.lang.swift.decl.enumelement", + "warning": "undocumented" + }, + { + "file": "/Users/veronique/Documents/iap-swift-lib/Sources/InAppPurchaseLib/Product/SKProductExtension.swift", + "line": 20, + "symbol": "SKProduct.localizedPeriodFormat", + "symbol_kind": "source.lang.swift.decl.var.static", + "warning": "undocumented" + } + ], + "source_directory": "/Users/veronique/Documents/iap-swift-lib" +} \ No newline at end of file diff --git a/docs/DefaultPurchaseDelegate/index.html b/docs/swift-doc/DefaultPurchaseDelegate/index.html similarity index 67% rename from docs/DefaultPurchaseDelegate/index.html rename to docs/swift-doc/DefaultPurchaseDelegate/index.html index ded1307..60ef6bd 100755 --- a/docs/DefaultPurchaseDelegate/index.html +++ b/docs/swift-doc/DefaultPurchaseDelegate/index.html @@ -4,12 +4,12 @@ InAppPurchase - DefaultPurchaseDelegate - +
- + InAppPurchase @@ -39,40 +39,46 @@

public class DefaultPurchaseDelegate: IAPPurchaseDelegate
+
+

The default implementation of IAPPurchaseDelegate if no other is provided.

+ +
- - + -%3 -DefaultPurchaseDelegate + +DefaultPurchaseDelegate -DefaultPurchaseDelegate +DefaultPurchaseDelegate -IAPPurchaseDelegate + +IAPPurchaseDelegate - -IAPPurchaseDelegate + +IAPPurchaseDelegate -DefaultPurchaseDelegate->IAPPurchaseDelegate - - + +DefaultPurchaseDelegate->IAPPurchaseDelegate + + @@ -83,7 +89,8 @@

Conforms To

IAPPurchaseDelegate
-
+

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

+
@@ -93,7 +100,7 @@

Initializers

init()

-
public required init()
+
public init()
@@ -104,6 +111,29 @@

product​Purchased(product​Identifier:​)

public func productPurchased(productIdentifier: String)
+
+

Finish the product transactions when a product is newly purchased, updated or restored.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
@@ -114,7 +144,7 @@

- Generated on using swift-doc. + Generated on using swift-doc.

diff --git a/docs/IAPError/index.html b/docs/swift-doc/IAPError/index.html similarity index 77% rename from docs/IAPError/index.html rename to docs/swift-doc/IAPError/index.html index eba534a..948cd13 100755 --- a/docs/IAPError/index.html +++ b/docs/swift-doc/IAPError/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPError - +
- + InAppPurchase @@ -45,34 +45,36 @@ - - + -%3 -IAPError + +IAPError -IAPError +IAPError -IAPErrorProtocol + +IAPErrorProtocol - -IAPErrorProtocol + +IAPErrorProtocol -IAPError->IAPErrorProtocol - - + +IAPError->IAPErrorProtocol + + @@ -110,7 +112,7 @@

diff --git a/docs/IAPErrorCode/index.html b/docs/swift-doc/IAPErrorCode/index.html similarity index 95% rename from docs/IAPErrorCode/index.html rename to docs/swift-doc/IAPErrorCode/index.html index 1678f88..aa4e9ad 100755 --- a/docs/IAPErrorCode/index.html +++ b/docs/swift-doc/IAPErrorCode/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPErrorCode - +
- + InAppPurchase @@ -112,7 +112,7 @@

diff --git a/docs/IAPErrorProtocol/index.html b/docs/swift-doc/IAPErrorProtocol/index.html similarity index 70% rename from docs/IAPErrorProtocol/index.html rename to docs/swift-doc/IAPErrorProtocol/index.html index 570387a..b4490ac 100755 --- a/docs/IAPErrorProtocol/index.html +++ b/docs/swift-doc/IAPErrorProtocol/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPErrorProtocol - +
- + InAppPurchase @@ -45,44 +45,48 @@ - - + -%3 -IAPErrorProtocol + +IAPErrorProtocol -IAPErrorProtocol +IAPErrorProtocol -LocalizedError - -LocalizedError + +LocalizedError + +LocalizedError -IAPErrorProtocol->LocalizedError - - + +IAPErrorProtocol->LocalizedError + + -IAPError - + +IAPError + -IAPError +IAPError -IAPError->IAPErrorProtocol - - + +IAPError->IAPErrorProtocol + + @@ -118,7 +122,7 @@

diff --git a/docs/IAPPeriodFormat/index.html b/docs/swift-doc/IAPPeriodFormat/index.html similarity index 88% rename from docs/IAPPeriodFormat/index.html rename to docs/swift-doc/IAPPeriodFormat/index.html index 2f52867..551b536 100755 --- a/docs/IAPPeriodFormat/index.html +++ b/docs/swift-doc/IAPPeriodFormat/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPPeriodFormat - +
- + InAppPurchase @@ -64,7 +64,7 @@

diff --git a/docs/IAPProduct/index.html b/docs/swift-doc/IAPProduct/index.html similarity index 68% rename from docs/IAPProduct/index.html rename to docs/swift-doc/IAPProduct/index.html index 791b2e4..db7e392 100755 --- a/docs/IAPProduct/index.html +++ b/docs/swift-doc/IAPProduct/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPProduct - +
- + InAppPurchase @@ -48,6 +48,41 @@

init(product​Identifier:​product​Type:​)

public init(productIdentifier: String, productType: IAPProductType)
+
+

Initializes an IAPProduct with its identifier and type.

+ +
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
product​TypeIAPProduct​Type

The type of the product.

+
@@ -58,12 +93,26 @@

product​Identifier

var productIdentifier: String
+
+

The identifier of the product.

+ +

product​Type

var productType: IAPProductType
+
+

The type of the product.

+ +
+
+ + +
@@ -74,7 +123,7 @@

- Generated on using swift-doc. + Generated on using swift-doc.

diff --git a/docs/IAPProductType/index.html b/docs/swift-doc/IAPProductType/index.html similarity index 92% rename from docs/IAPProductType/index.html rename to docs/swift-doc/IAPProductType/index.html index 52610f7..3f641db 100755 --- a/docs/IAPProductType/index.html +++ b/docs/swift-doc/IAPProductType/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPProductType - +
- + InAppPurchase @@ -76,7 +76,7 @@

diff --git a/docs/IAPPurchaseCallback/index.html b/docs/swift-doc/IAPPurchaseCallback/index.html similarity index 83% rename from docs/IAPPurchaseCallback/index.html rename to docs/swift-doc/IAPPurchaseCallback/index.html index 46785ba..7b663d9 100755 --- a/docs/IAPPurchaseCallback/index.html +++ b/docs/swift-doc/IAPPurchaseCallback/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPPurchaseCallback - +
- + InAppPurchase @@ -44,7 +44,7 @@

diff --git a/docs/IAPPurchaseDelegate/index.html b/docs/swift-doc/IAPPurchaseDelegate/index.html similarity index 61% rename from docs/IAPPurchaseDelegate/index.html rename to docs/swift-doc/IAPPurchaseDelegate/index.html index 6d14f18..58bda97 100755 --- a/docs/IAPPurchaseDelegate/index.html +++ b/docs/swift-doc/IAPPurchaseDelegate/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPPurchaseDelegate - +
- + InAppPurchase @@ -39,40 +39,46 @@

public protocol IAPPurchaseDelegate
+
+

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

+ +
- - + -%3 -IAPPurchaseDelegate + +IAPPurchaseDelegate - -IAPPurchaseDelegate + +IAPPurchaseDelegate -DefaultPurchaseDelegate + +DefaultPurchaseDelegate -DefaultPurchaseDelegate +DefaultPurchaseDelegate -DefaultPurchaseDelegate->IAPPurchaseDelegate - - + +DefaultPurchaseDelegate->IAPPurchaseDelegate + + @@ -83,7 +89,8 @@

Types Conforming to IAPPurchase​Delegate

DefaultPurchaseDelegate
-
+

The default implementation of IAPPurchaseDelegate if no other is provided.

+
@@ -96,7 +103,36 @@

Requirements

product​Purchased(product​Identifier:​)

-
func productPurchased(productIdentifier: String)
+
func productPurchased(productIdentifier: String) -> Void
+
+

Called when a product is newly purchased, updated or restored.

+ +
+
+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
@@ -104,7 +140,7 @@

- Generated on using swift-doc. + Generated on using swift-doc.

diff --git a/docs/IAPPurchaseResult/index.html b/docs/swift-doc/IAPPurchaseResult/index.html similarity index 76% rename from docs/IAPPurchaseResult/index.html rename to docs/swift-doc/IAPPurchaseResult/index.html index deac7d2..19f0064 100755 --- a/docs/IAPPurchaseResult/index.html +++ b/docs/swift-doc/IAPPurchaseResult/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPPurchaseResult - +
- + InAppPurchase @@ -27,7 +27,7 @@ @@ -60,6 +60,12 @@

sk​Error

var skError: SKError?
+ +
+

+ localized​Description +

+
var localizedDescription: String?
@@ -70,7 +76,7 @@

- Generated on using swift-doc. + Generated on using swift-doc.

diff --git a/docs/IAPPurchaseResultState/index.html b/docs/swift-doc/IAPPurchaseResultState/index.html similarity index 91% rename from docs/IAPPurchaseResultState/index.html rename to docs/swift-doc/IAPPurchaseResultState/index.html index 9a235a7..9722438 100755 --- a/docs/IAPPurchaseResultState/index.html +++ b/docs/swift-doc/IAPPurchaseResultState/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPPurchaseResultState - +
- + InAppPurchase @@ -76,7 +76,7 @@

diff --git a/docs/IAPRefreshCallback/index.html b/docs/swift-doc/IAPRefreshCallback/index.html similarity index 83% rename from docs/IAPRefreshCallback/index.html rename to docs/swift-doc/IAPRefreshCallback/index.html index dbca3a3..5184db2 100755 --- a/docs/IAPRefreshCallback/index.html +++ b/docs/swift-doc/IAPRefreshCallback/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPRefreshCallback - +
- + InAppPurchase @@ -44,7 +44,7 @@

diff --git a/docs/IAPRefreshResult/index.html b/docs/swift-doc/IAPRefreshResult/index.html similarity index 92% rename from docs/IAPRefreshResult/index.html rename to docs/swift-doc/IAPRefreshResult/index.html index ea4c742..7d40928 100755 --- a/docs/IAPRefreshResult/index.html +++ b/docs/swift-doc/IAPRefreshResult/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPRefreshResult - +
- + InAppPurchase @@ -76,7 +76,7 @@

diff --git a/docs/IAPRefreshResultState/index.html b/docs/swift-doc/IAPRefreshResultState/index.html similarity index 90% rename from docs/IAPRefreshResultState/index.html rename to docs/swift-doc/IAPRefreshResultState/index.html index e0c657e..34365cd 100755 --- a/docs/IAPRefreshResultState/index.html +++ b/docs/swift-doc/IAPRefreshResultState/index.html @@ -4,12 +4,12 @@ InAppPurchase - IAPRefreshResultState - +
- + InAppPurchase @@ -70,7 +70,7 @@

diff --git a/docs/InAppPurchase/index.html b/docs/swift-doc/InAppPurchase/index.html similarity index 54% rename from docs/InAppPurchase/index.html rename to docs/swift-doc/InAppPurchase/index.html index a768e04..559e980 100755 --- a/docs/InAppPurchase/index.html +++ b/docs/swift-doc/InAppPurchase/index.html @@ -4,12 +4,12 @@ InAppPurchase - InAppPurchase - +
- + InAppPurchase @@ -27,7 +27,7 @@ @@ -45,44 +45,48 @@ - - + -%3 -InAppPurchase + +InAppPurchase -InAppPurchase +InAppPurchase -NSObject - -NSObject + +NSObject + +NSObject -InAppPurchase->NSObject - - + +InAppPurchase->NSObject + + -InAppPurchaseLib + +InAppPurchaseLib - -InAppPurchaseLib + +InAppPurchaseLib -InAppPurchase->InAppPurchaseLib - - + +InAppPurchase->InAppPurchaseLib + + @@ -93,7 +97,8 @@

Conforms To

InAppPurchaseLib
-
+

The protocol that `InAppPurchase`` adopts.

+
NSObject
@@ -105,118 +110,471 @@

iap​Products

var iapProducts: Array<IAPProduct>
+
+

The array of IAPProduct.

+
-
-

- iap​Purchase​Delegate -

-
var iapPurchaseDelegate: IAPPurchaseDelegate?

validator​Url​String

var validatorUrlString: String?
+
+

The validator url retrieved from Fovea.

+ +
+
+
+

+ iap​Purchase​Delegate +

+
var iapPurchaseDelegate: IAPPurchaseDelegate?
+
+

The instance of class that adopts the IAPPurchaseDelegate protocol.

+ +

application​Username

var applicationUsername: String?
+
+

The user name, if your app implements user login.

+ +

Methods

-
+

- initialize(iap​Products:​iap​Purchase​Delegate:​validator​Url​String:​application​Username:​) + initialize(iap​Products:​validator​Url​String:​iap​Purchase​Delegate:​application​Username:​)

-
public static func initialize(iapProducts: Array<IAPProduct>, iapPurchaseDelegate: IAPPurchaseDelegate, validatorUrlString: String, applicationUsername: String?)
+
public static func initialize(iapProducts: Array<IAPProduct>, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?)
+
+

Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
iap​ProductsArray<IAPProduct>

An array of IAPProduct.

+
validator​Url​StringString

The validator url retrieved from Fovea.

+
iap​Purchase​DelegateIAPPurchase​Delegate

An instance of class that adopts the IAPPurchaseDelegate protocol (default value = DefaultPurchaseDelegate).

+
application​UsernameString?

The user name, if your app implements user login.

+

stop()

public static func stop()
+
+

Stop observing the payment queue, when the application will terminate, for proper cleanup.

+ +

refresh(callback:​)

public static func refresh(callback: @escaping IAPRefreshCallback)
+
+

Refresh Product list and user Receipt.

+ +
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + +
callback@escaping IAPRefresh​Callback

The function that will be called after processing.

+

get​Products()

public static func getProducts() -> Array<SKProduct>
+
+

Gets all products retrieved from the App Store

+ +
+
+
    +
  • See also: SKProduct.
  • +
+ +
+

Returns

+

An array of products.

+

get​Product​By(identifier:​)

public static func getProductBy(identifier: String) -> SKProduct?
+
+

Gets the product by its identifier from the list of products retrieved from the App Store.

+ +
+
+
    +
  • See also: SKProduct.
  • +
+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
identifierString

The identifier of the product.

+
+

Returns

+

The product if it was retrieved from the App Store.

+ +
+
+

+ can​Make​Payments() +

+
public static func canMakePayments() -> Bool
+
+

Checks if the user is allowed to authorize payments.

+ +
+

Returns

+

A boolean indicates if the user is allowed.

+

purchase(product​Identifier:​quantity:​callback:​)

public static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback)
+
+

Request a Payment from the App Store.

+ +
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product to purchase.

+
quantityInt

The quantity to purchase (default value = 1).

+
callback@escaping IAPPurchase​Callback

The function that will be called after processing.

+

restore​Purchases(callback:​)

public static func restorePurchases(callback: @escaping IAPRefreshCallback)
+
+

Restore purchased products.

+
-
-

- can​Make​Payments() -

-
public static func canMakePayments() -> Bool
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + +
callback@escaping IAPRefresh​Callback

The function that will be called after processing.

+

finish​Transactions(for:​)

public static func finishTransactions(for productIdentifier: String)
+
+

Finish all transactions for the product.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+

has​Deferred​Transaction(for:​)

public static func hasDeferredTransaction(for productIdentifier: String) -> Bool
+
+

Checks if the last transaction state for a given product was deferred.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

A boolean indicates if the last transaction state was deferred.

+

has​Already​Purchased()

public static func hasAlreadyPurchased() -> Bool
+
+

Checks if the user has already purchased at least one product.

+ +
+

Returns

+

A boolean indicates if the .

+

has​Active​Purchase(for:​)

public static func hasActivePurchase(for productIdentifier: String) -> Bool
+
+

Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

A boolean indicates if the user currently own (or is subscribed to) a given product.

+

has​Active​Subscription()

public static func hasActiveSubscription() -> Bool
+
+

Checks if the user has an active auto renewable subscription regardless of the product identifier.

+ +
+

Returns

+

A boolean indicates if the user has an active auto renewable subscription.

+

get​Purchase​Date(for:​)

public static func getPurchaseDate(for productIdentifier: String) -> Date?
+
+

Returns the latest purchased date for a given product.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

The latest purchase Date if set or nil.

+

get​Expiry​Date(for:​)

public static func getExpiryDate(for productIdentifier: String) -> Date?
+
+

Returns the expiry date for a subcription. May be past or future.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

The expiry Date is set or nil.

+
@@ -227,7 +585,7 @@

- Generated on using swift-doc. + Generated on using swift-doc.

diff --git a/docs/InAppPurchaseLib/index.html b/docs/swift-doc/InAppPurchaseLib/index.html similarity index 53% rename from docs/InAppPurchaseLib/index.html rename to docs/swift-doc/InAppPurchaseLib/index.html index 439a315..5f0d7ed 100755 --- a/docs/InAppPurchaseLib/index.html +++ b/docs/swift-doc/InAppPurchaseLib/index.html @@ -4,12 +4,12 @@ InAppPurchase - InAppPurchaseLib - +
- + InAppPurchase @@ -27,7 +27,7 @@ @@ -39,40 +39,46 @@

public protocol InAppPurchaseLib
+
+

The protocol that `InAppPurchase`` adopts.

+ +
- - + -%3 -InAppPurchaseLib + +InAppPurchaseLib - -InAppPurchaseLib + +InAppPurchaseLib -InAppPurchase + +InAppPurchase -InAppPurchase +InAppPurchase -InAppPurchase->InAppPurchaseLib - - + +InAppPurchase->InAppPurchaseLib + + @@ -97,114 +103,467 @@

iap​Products

var iapProducts: Array<IAPProduct>
+
+

The array of IAPProduct.

+
-
-

- iap​Purchase​Delegate -

-
var iapPurchaseDelegate: IAPPurchaseDelegate?

validator​Url​String

var validatorUrlString: String?
+
+

The validator url retrieved from Fovea.

+ +
+
+
+

+ iap​Purchase​Delegate +

+
var iapPurchaseDelegate: IAPPurchaseDelegate?
+
+

The instance of class that adopts the IAPPurchaseDelegate protocol.

+ +

application​Username

var applicationUsername: String?
+
+

The user name, if your app implements user login.

+
-
+
+

- initialize(iap​Products:​iap​Purchase​Delegate:​validator​Url​String:​application​Username:​) + initialize(iap​Products:​validator​Url​String:​iap​Purchase​Delegate:​application​Username:​)

-
static func initialize(iapProducts: Array<IAPProduct>, iapPurchaseDelegate: IAPPurchaseDelegate, validatorUrlString: String, applicationUsername: String?)
+
static func initialize(iapProducts: Array<IAPProduct>, validatorUrlString: String, iapPurchaseDelegate: IAPPurchaseDelegate, applicationUsername: String?) -> Void
+
+

Start observing the payment queue, as soon as possible, and refresh Product list and user Receipt.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
iap​ProductsArray<IAPProduct>

An array of IAPProduct.

+
validator​Url​StringString

The validator url retrieved from Fovea.

+
iap​Purchase​DelegateIAPPurchase​Delegate

An instance of class that adopts the IAPPurchaseDelegate protocol (default value = DefaultPurchaseDelegate).

+
application​UsernameString?

The user name, if your app implements user login.

+

stop()

-
static func stop()
+
static func stop() -> Void
+
+

Stop observing the payment queue, when the application will terminate, for proper cleanup.

+ +

refresh(callback:​)

-
static func refresh(callback: @escaping IAPRefreshCallback)
+
static func refresh(callback: @escaping IAPRefreshCallback) -> Void
+
+

Refresh Product list and user Receipt.

+ +
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + +
callback@escaping IAPRefresh​Callback

The function that will be called after processing.

+

get​Products()

static func getProducts() -> Array<SKProduct>
+
+

Gets all products retrieved from the App Store

+ +
+
+
    +
  • See also: SKProduct.
  • +
+ +
+

Returns

+

An array of products.

+

get​Product​By(identifier:​)

static func getProductBy(identifier: String) -> SKProduct?
+
+

Gets the product by its identifier from the list of products retrieved from the App Store.

+ +
+
+
    +
  • See also: SKProduct.
  • +
+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
identifierString

The identifier of the product.

+
+

Returns

+

The product if it was retrieved from the App Store.

+

can​Make​Payments()

static func canMakePayments() -> Bool
+
+

Checks if the user is allowed to authorize payments.

+ +
+

Returns

+

A boolean indicates if the user is allowed.

+

purchase(product​Identifier:​quantity:​callback:​)

-
static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback)
+
static func purchase(productIdentifier: String, quantity: Int, callback: @escaping IAPPurchaseCallback) -> Void
+
+

Request a Payment from the App Store.

+ +
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product to purchase.

+
quantityInt

The quantity to purchase (default value = 1).

+
callback@escaping IAPPurchase​Callback

The function that will be called after processing.

+

restore​Purchases(callback:​)

-
static func restorePurchases(callback: @escaping IAPRefreshCallback)
+
static func restorePurchases(callback: @escaping IAPRefreshCallback) -> Void
+
+

Restore purchased products.

+ +
+
+ + +
+

Parameters

+ + + + + + + + + + + + + + + + +
callback@escaping IAPRefresh​Callback

The function that will be called after processing.

+

finish​Transactions(for:​)

-
static func finishTransactions(for productIdentifier: String)
+
static func finishTransactions(for productIdentifier: String) -> Void
+
+

Finish all transactions for the product.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+

has​Deferred​Transaction(for:​)

static func hasDeferredTransaction(for productIdentifier: String) -> Bool
+
+

Checks if the last transaction state for a given product was deferred.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

A boolean indicates if the last transaction state was deferred.

+

has​Already​Purchased()

static func hasAlreadyPurchased() -> Bool
+
+

Checks if the user has already purchased at least one product.

+ +
+

Returns

+

A boolean indicates if the .

+

has​Active​Purchase(for:​)

static func hasActivePurchase(for productIdentifier: String) -> Bool
+
+

Checks if the user currently own (or is subscribed to) a given product (nonConsumable or autoRenewableSubscription).

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

A boolean indicates if the user currently own (or is subscribed to) a given product.

+

has​Active​Subscription()

static func hasActiveSubscription() -> Bool
+
+

Checks if the user has an active auto renewable subscription regardless of the product identifier.

+ +
+

Returns

+

A boolean indicates if the user has an active auto renewable subscription.

+

get​Purchase​Date(for:​)

static func getPurchaseDate(for productIdentifier: String) -> Date?
+
+

Returns the latest purchased date for a given product.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

The latest purchase Date if set or nil.

+

get​Expiry​Date(for:​)

static func getExpiryDate(for productIdentifier: String) -> Date?
+
+

Returns the expiry date for a subcription. May be past or future.

+ +
+

Parameters

+ + + + + + + + + + + + + + + + +
product​IdentifierString

The identifier of the product.

+
+

Returns

+

The expiry Date is set or nil.

+
@@ -212,7 +571,7 @@

- Generated on using swift-doc. + Generated on using swift-doc.

diff --git a/docs/all.css b/docs/swift-doc/all.css similarity index 100% rename from docs/all.css rename to docs/swift-doc/all.css diff --git a/docs/index.html b/docs/swift-doc/index.html similarity index 88% rename from docs/index.html rename to docs/swift-doc/index.html index e1e1b7d..666ea3b 100755 --- a/docs/index.html +++ b/docs/swift-doc/index.html @@ -4,12 +4,12 @@ InAppPurchase - InAppPurchase - +
- + InAppPurchase @@ -50,7 +50,8 @@

Classes

- +

The default implementation of IAPPurchaseDelegate if no other is provided.

+
@@ -153,7 +154,8 @@

Protocols

- +

The protocol that `InAppPurchase`` adopts.

+
@@ -161,7 +163,8 @@

Protocols

- +

The protocol that you must adopt if you have consumable and/or nonRenewingSubscription products.

+
@@ -194,7 +197,7 @@

Typealiases