Product definition from a store

Hierarchy (view full)

Properties

description: string = ''

Product full description from the store.

group?: string

Group the product is member of.

Only 1 product of a given group can be owned. This is generally used to provide different levels for subscriptions, for example: silver and gold.

Purchasing a different level will replace the previously owned one.

id: string

Product identifier on the store (unique per platform)

offers: Offer[]

List of offers available for this product

platform: Platform

Platform this product is available from

title: string = ''

Product title from the store.

Type of product (subscription, consumable, etc.)

Accessors

  • get canPurchase(): boolean
  • Returns true if the product can be purchased.

    Returns boolean

  • get owned(): boolean
  • Returns true if the product is owned.

    Returns boolean

  • get pricing(): undefined | CdvPurchase.PricingPhase
  • Shortcut to offers[0].pricingPhases[0]

    Useful when you know products have a single offer and a single pricing phase.

    Returns undefined | CdvPurchase.PricingPhase

Methods

  • Find and return an offer for this product from its id

    If id isn't specified, returns the first offer.

    Parameters

    • id: string = ''

      Identifier of the offer to return

    Returns undefined | Offer

    An Offer or undefined if no match is found