Dear fellow Corona users,
I have a problem related to Banner Ad, when I read the guide about how to use multiple Ad network, I implemented my iAd Listener as below:
local function iAdsListener( event ) print(event.response); if ( event.type == "adStart" and event.isError ) then ads:setCurrentProvider( "admob" ); ads.show( "banner", { x=0, y=0 } ); elseif ( event.type == "adEnd" ) then -- Ad was successfully shown and ended -- Do nothing else print( "Received event", event.type ); end return true end
The iAd was shown successfully in my app but unfortunately iAd is only available in some countries, for all the countries that iAd has not supported yet, Admob ad never shown up.
So my question is, how to detect when iAd is not available?
Here is the response I got from event.response when iAd is not available:
The operation couldn’t be completed. Ad inventory unavailable
Based on the event.response, can I do something like this in my iAd listener?
local function iAdsListener( event ) if (string.find(event.response, "Ad inventory unavailable") ~= nil) then ads:setCurrentProvider( "admob" ); ads.show( "banner", { x=0, y=0 } ); end return true end
Thanks and regards,
Tran