Type Function Return value none Revision 2017.3060 Keywords ads, advertising, InMobi, hide See also inMobi.show() inMobi.*
Hides a currently displayed InMobi banner ad. Does not apply to interstitial ads.
inMobi.hide( placementID )
String. The placement ID for the currently displayed ad, retrieved from the InMobi developer portal.
local inMobi = require( "plugin.inMobi" )
-- Pre-declare a placement ID
local placementID = "PLACEMENT_ID"
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
-- Load a banner ad
inMobi.load( "banner", placementID )
elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded
-- Show the ad
inMobi.show( event.type, event.placementId, { yAlign="bottom" } )
elseif ( event.phase == "failed" ) then -- The ad failed to load
print( event.type )
print( event.placementId )
print( event.isError )
print( event.response )
end
end
-- Initialize the InMobi plugin
inMobi.init( adListener, { accountId="YOUR_ACCOUNT_ID" } )
-- Sometime later, hide the ad
inMobi.hide( placementID )