mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Added new getProduct
method and fixed naming of consumePurchases
.
This commit is contained in:
parent
9ad4ed6d8f
commit
0a87a0bdef
2 changed files with 35 additions and 3 deletions
|
@ -36,6 +36,11 @@ Notes:
|
||||||
* `ArcadePhysics.furthest` now iterates the bodies Set, rather than the RTree, which keeps it working even if the RTree has been disabled.
|
* `ArcadePhysics.furthest` now iterates the bodies Set, rather than the RTree, which keeps it working even if the RTree has been disabled.
|
||||||
* `ArcadePhysics.closest` now iterates the bodies Set, rather than the RTree, which keeps it working even if the RTree has been disabled.
|
* `ArcadePhysics.closest` now iterates the bodies Set, rather than the RTree, which keeps it working even if the RTree has been disabled.
|
||||||
|
|
||||||
|
### Facebook Instant Games Plugin
|
||||||
|
|
||||||
|
* The method `consumePurchases` has been renamed to `consumePurchase` to bring it in-line with the Facebook API.
|
||||||
|
* `getProduct` is a new method that will return a single Product from the product catalog based on the given Product ID. You can use this to look-up product details based on a purchase list.
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
|
|
||||||
* There is a new Game Config property `input.windowEvents` which is true by default. It controls if Phaser will listen for any input events on the Window. If you disable this, Phaser will stop being able to emit events like `POINTER_UP_OUTSIDE`, or be aware of anything that happens outside of the Canvas re: input.
|
* There is a new Game Config property `input.windowEvents` which is true by default. It controls if Phaser will listen for any input events on the Window. If you disable this, Phaser will stop being able to emit events like `POINTER_UP_OUTSIDE`, or be aware of anything that happens outside of the Canvas re: input.
|
||||||
|
|
|
@ -1460,6 +1460,33 @@ var FacebookInstantGamesPlugin = new Class({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches a single Product from the game's product catalog.
|
||||||
|
*
|
||||||
|
* The product catalog must have been populated using `getCatalog` prior to calling this method.
|
||||||
|
*
|
||||||
|
* Use this to look-up product details based on a purchase list.
|
||||||
|
*
|
||||||
|
* @method Phaser.FacebookInstantGamesPlugin#getProduct
|
||||||
|
* @since 3.17.0
|
||||||
|
*
|
||||||
|
* @param {string} productID - The Product ID of the item to get from the catalog.
|
||||||
|
*
|
||||||
|
* @return {?Product} The Product from the catalog, or `null` if it couldn't be found or the catalog isn't populated.
|
||||||
|
*/
|
||||||
|
getProduct: function (productID)
|
||||||
|
{
|
||||||
|
for (var i = 0; i < this.catalog.length; i++)
|
||||||
|
{
|
||||||
|
if (this.catalog[i].productID === productID)
|
||||||
|
{
|
||||||
|
return this.catalog[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begins the purchase flow for a specific product.
|
* Begins the purchase flow for a specific product.
|
||||||
*
|
*
|
||||||
|
@ -1569,14 +1596,14 @@ var FacebookInstantGamesPlugin = new Class({
|
||||||
* If they cannot, i.e. it's not in the list of supported APIs, or the request
|
* If they cannot, i.e. it's not in the list of supported APIs, or the request
|
||||||
* was rejected, it will emit a `consumepurchasefail` event instead.
|
* was rejected, it will emit a `consumepurchasefail` event instead.
|
||||||
*
|
*
|
||||||
* @method Phaser.FacebookInstantGamesPlugin#consumePurchases
|
* @method Phaser.FacebookInstantGamesPlugin#consumePurchase
|
||||||
* @since 3.13.0
|
* @since 3.17.0
|
||||||
*
|
*
|
||||||
* @param {string} purchaseToken - The purchase token of the purchase that should be consumed.
|
* @param {string} purchaseToken - The purchase token of the purchase that should be consumed.
|
||||||
*
|
*
|
||||||
* @return {this} This Facebook Instant Games Plugin instance.
|
* @return {this} This Facebook Instant Games Plugin instance.
|
||||||
*/
|
*/
|
||||||
consumePurchases: function (purchaseToken)
|
consumePurchase: function (purchaseToken)
|
||||||
{
|
{
|
||||||
if (!this.paymentsReady)
|
if (!this.paymentsReady)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue