StoreAccess
public class StoreAccess: NSObject, SKProductsRequestDelegate, SKPaymentTransactionObserver
StoreAccess is responsible for requesting products from the store, providing information about products by conforming to StoreProductsDataSource, purchasing products and restoring previous purchases.
-
Provides identifier for product that was purchased or restored.
Declaration
Swift
public typealias PurchaseCompletionBlock = (_ purchasedProductIdentifier: String) -> ()Parameters
purchasedProductIdentifierIdentifier for product that was purchased.
-
A closure that is executed when product purchased.
Warning
If this is nil,StoreAccesswon’t be able to purchase product or restore purchases.Declaration
Swift
public var purchaseCompletionHandler: PurchaseCompletionBlock? -
Current
StoreAccessstate.Declaration
Swift
public fileprivate(set) var state: StoreAccessState = .unknown -
StoreAccesssingleton.Declaration
Swift
public class var shared: StoreAccess -
Starts a request for products with provided identifiers.
- paramater identifiers: Set of identifiers for products to be requested.
Declaration
Swift
public func requestProductsWithIdentifiers(_ identifiers: Set<String>) -
Start purchasing product with provided identifier.
- paramater identifier: Identifier for product to be purchased.
Declaration
Swift
public func purchaseProductWithIdentifier(_ identifier: String) -
Start restoring previous purchases.
Declaration
Swift
public func restorePurchases()
View on GitHub
StoreAccess Class Reference