StoreFrontDelegate
@objc public protocol StoreFrontDelegate: class
Delegate for handling purchases and purchase errors.
-
Purchase success handler delegate. This will be invoked if a user has completed a real money purchase flow or if the player can afford the product with in game currency.
Declaration
Swift
func onPurchaseSuccess(productID: String, product: ProductData, isRestoring: Bool)Parameters
productIDThe product identifier.
productThe product data object
isRestoringTRUE if the product was awarded by a restore transactions call
-
Purchase failed handler delegate. Will be invoked if a purchase failed or canceled during the store flow.
Declaration
Swift
func onPurchaseFailed(productID: String, product: ProductData, reason: FailReason, isRestoring: Bool)Parameters
productIDThe product identifier.
productThe product data object
reasonFail reason enum
isRestoringTRUE if the product was awarded by a restore transactions call
-
Invalid product handler delegate. Will be invoked if a real money product does not exist in the catalogue or if the attempted product to purchase does not exist in the list.
Declaration
Swift
func onInvalidProduct(productID: String, isRestoring: Bool)Parameters
productIDThe product identifier.
isRestoringTRUE if the product was awarded by a restore transactions call
-
Not enough currency handler delegate. Event is invoked when an attempt at purchasing a valid game currency product can not be afforded because the user does not have enough game currency to purchase it.
Declaration
Swift
func onNotEnoughCurrency(productID: String, product: ProductData, necCosts: [CostItem])Parameters
productIDThe product identifier.
productThe product data object
necCostsList of costs that could not be afforded. Ones that can be afforded will not be included.
-
Restore all previous purchases handler delegate. Event is invoked once the restore purchases flow is complete.
Declaration
Swift
func onRestorePurchasesComplete(succeeded: Bool)Parameters
succeededA boolean for whether or not the restore process completed successfully.
StoreFrontDelegate Protocol Reference