diff --git a/CHANGELOG.md b/CHANGELOG.md index 306c7130b..80cadd19c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/plugins/fbinstant/src/FacebookInstantGamesPlugin.js b/plugins/fbinstant/src/FacebookInstantGamesPlugin.js index d65701d1f..ce6755cb9 100644 --- a/plugins/fbinstant/src/FacebookInstantGamesPlugin.js +++ b/plugins/fbinstant/src/FacebookInstantGamesPlugin.js @@ -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 () {