admob.showConsentForm()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, AdMob, hide
See also admob.getConsentFormStatus()
admob.*

Overview

This function shows Consent Form to be displayed (if loaded)

Syntax

admob.showConsentForm()

Example

local admob = require( "plugin.admob" )


-- Initialize the AdMob plugin

local function adListener( event )
        if ( event.phase == "init" ) then  -- Successful initialization
            local formStatus, consentStatus = admob.getConsentFormStatus()

            if(formStatus == "available")then -- recommend (not required)
                admob.loadConsentForm()
            end
        end
        if(event.phase == "loaded" and event.type == "ump")then
            admob.showConsentForm()
        end
end

admob.init( adListener, { appId="YOUR_ADMOB_APP_ID" } )