UseProductsResult
What useProducts answers.
Methods
Section titled “Methods”buy<
Key>(this,key,options?):Promise<BuyResult>
Asks the app to sell the player key: the app shows its own sheet,
with the platform’s name, price and refund rule, and resolves with
how the purchase ended. A consumable resolves bought once its
grant is in a committed save, returned once its Spawnites went back,
and queued at once where it waits for the player’s next seat. A
context the product’s schema refuses, or a label past 60 characters,
resolves unavailable before the sheet opens. A second call for a
key while one is pending answers the same promise. Outside the app,
it resolves unavailable.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Key extends string |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
this |
void |
key |
Key |
options? |
BuyOptions<Key> |
Returns
Section titled “Returns”Promise<BuyResult>
owns()
Section titled “owns()”owns(
this,key):boolean
Whether the player owns the durable product key, as the platform
last answered: true once a purchase of it landed, and false once it
was taken back, as a refund or a chargeback takes it. The component
renders again as it changes. For what the page draws, such as the
shop: a room decides what a product does with ownsProduct. False
outside the app.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
this |
void |
key |
string |
Returns
Section titled “Returns”boolean