I’m trying to load Facebook instant game ads several times using two placement IDs using bellow functionality,
-- Preload ad unit
function load_ad_unit(ad_unit_id)
print("loading ad unit...")
fbinstant.load_interstitial_ad(
ad_unit_id,
function(self, success)
if success then
print("Ad unit successfully loaded ")
else
print("Ad unit doesn't loaded ", ad_unit_id)
end
end
)
end
-- Show ad unit
function show_ad_unit(ad_unit_id)
fbinstant.show_interstitial_ad(
ad_unit_id,
function(self, success)
if success then
print("Ad unit successfully opened ", ad_unit_id)
-- * I put this here because `show_interstitial_ad`
-- handles removing the ad instance
load_ad_unit(ad_unit_id)
else
print("Ad unit doesn't opened ", ad_unit_id)
end
end
)
end
function on_message(self, message_id, message, sender)
if message_id == hash("NEW_GAME") then
load_ad_unit("<ad_unit_id>")
elseif message_id == hash("ON_PRESS") then
show_ad_unit("<ad_unit_id>")
end
end
But this only works once at the beginning of the game when I press a button. For the second time, it won't work. Below are errors that occur in most situations,
> FBInstant_PlatformShowInterstitialAdAsync - unable to find ad. Did you load it?
> FBInstant_PlatformLoadInterstitialAdAsync - error a {code: "ADS_NO_FILL", message: "No fill"}
> FBInstant_PlatformLoadInterstitialAdAsync - error a {code: "ADS_TOO_MANY_INSTANCES", message: "Too many ad instances"}
I’m trying to load Facebook instant game ads several times using two placement IDs using bellow functionality,
But this only works once at the beginning of the game when I press a button. For the second time, it won't work. Below are errors that occur in most situations,
This issue is from the forum: https://forum.defold.com/t/facebook-instant-games-ads-not-loading-more-than-once/43392