Calling showAd or showVideoAd will now check to see if the ad has already been displayed, and skip it when iterating the ads array, allowing you to display an ad with the same Placement ID without preloading it again. Fix #4728

This commit is contained in:
Richard Davey 2019-09-26 13:11:28 +01:00
parent 107bccf105
commit 163ab4fc19
2 changed files with 6 additions and 2 deletions

View file

@ -2,6 +2,10 @@
## Version 3.20.0 - Fitoria - in dev
### Facebook Instant Games Plugin
* Calling `showAd` or `showVideoAd` will now check to see if the ad has already been displayed, and skip it when iterating the ads array, allowing you to display an ad with the same Placement ID without preloading it again. Fix #4728 (thanks @NokFrt)
### New Features
* `GameConfig.antialiasGL` is a new boolean that allows you to set the `antialias` property of the WebGL context during creation, without impacting any subsequent textures or the canvas CSS.

View file

@ -2087,7 +2087,7 @@ var FacebookInstantGamesPlugin = new Class({
{
var ad = this.ads[i];
if (ad.placementID === placementID)
if (ad.placementID === placementID && !ad.shown)
{
ad.instance.showAsync().then(function ()
{
@ -2136,7 +2136,7 @@ var FacebookInstantGamesPlugin = new Class({
{
var ad = this.ads[i];
if (ad.placementID === placementID && ad.video)
if (ad.placementID === placementID && ad.video && !ad.shown)
{
ad.instance.showAsync().then(function ()
{