ProductData

@objc public class ProductData: NSObject, Gloss.Decodable

Class describing a product. Used to make a purchase.

  • A purchase that can be made multiple times.

    Declaration

    Swift

    public static let CONSUMABLE = "consumable"
  • A purchase that is made once and can be restored.

    Declaration

    Swift

    public static let NONCONSUMABLE = "nonconsumable"
  • A recurring purchase.

    Declaration

    Swift

    public static let SUBSCRIPTION = "subscription"
  • The type of purchase. ex: consumable, nonconsumable. Used with IAP libraries.

    Declaration

    Swift

    public var purchaseType = ""
  • sku

    Purchasing sku used with Apple purchasing system.

    Declaration

    Swift

    public var sku = ""
  • List of costs to acquire the product. A product can either cost a single money amount or multiples of in game currency.

    Declaration

    Swift

    public var costItems: [CostItem] = []
  • List of items to reward upon successful purchase.

    Declaration

    Swift

    public var rewardItems: [RewardItem] = []
  • Initializes a ProductData object from a JSON object.

    Declaration

    Swift

    public required init?(json: JSON)

    Parameters

    json

    The json object to parse.

  • Returns a bool indicating if this product uses real money to be purchased.

    Declaration

    Swift

    public func isRealMoneyPurchase() -> Bool

    Return Value

    TRUE if this product contains a SKU.