Class AirshipPurchaseSingleton

Prompt players to buy products in your game.

Methods

  • Opens a purchase dialog for the user. It will prompt them to confirm the purchase provided. If the user completes the purchase, a receipt fulfillment event will be fired on the server.

    Parameters

    • productId: string

      The product to be purchased. You can find the ID in the create dashboard.

    • quantity: number

      The amount of this product to purchase.

    • Optional purchaserUserId: string

      The user that will purchase the product. If called on client this defaults to the local player id.

    • Optional recipientUserId: string

      The user that will receive the product. If not provided, it defaults to purchaserUserId.

    Returns Promise<boolean>

    true if the prompt was displayed.