Product

public class Product : Hashable, Equatable

This type represents information about a product that can be purchased in your app.

This is used by the purchaseRequired conditional feature availability type, allowing you to bind Features to one or more Product, so that if the product is purchased, a group of features can become available.

Note

We use class semantics here so that the app can subclass it to include additional properties as required for the purchasing mechanism they use.

  • The name of the product, for display to the user and debugging. e.g. Premium Subscription

    Declaration

    Swift

    public let name: String
  • The description of the product, for display to the user. e.g. Unlocks all features

    Declaration

    Swift

    public let description: String
  • A product ID used by your purchase subsystem to uniquely identify the product that to be purchased

    Declaration

    Swift

    public let productID: String
  • Undocumented

    Declaration

    Swift

    public init(name: String, description: String, productID: String)
  • Declaration

    Swift

    public var hashValue: Int { get }
  • Declaration

    Swift

    public static func == (lhs: Product, rhs: Product) -> Bool