kidoz.hide()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, KIDOZ, hide
See also kidoz.show()
kidoz.*

Overview

Hides a KIDOZ ad which was previously shown via kidoz.show().

Syntax

kidoz.hide( adType )
adType (required)

String. The ad type to hide. Valid values include "panelView", and "banner".

Example

local kidoz = require( "plugin.kidoz" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.provider )
        -- Load a KIDOZ panel view ad
        kidoz.load( "panelView", { adPosition="bottom" } )

    elseif ( event.phase == "loaded" ) then  -- The ad was successfully loaded
        print( event.type )
        -- Show the ad
        kidoz.show( "panelView" )
    end
end

-- Initialize the KIDOZ plugin
kidoz.init( adListener, { publisherID="YOUR_PUBLISHER_ID", securityToken="YOUR_SECURITY_TOKEN" } )

-- Sometime later, hide the panel view
kidoz.hide( "panelView" )