applovin.setIsAgeRestrictedUser()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, AppLovin, setHasUserConsent
See also applovin.init()
applovin.load()
applovin.isLoaded()
applovin.setHasUserConsent()
applovin.*

Overview

Used to mark user as age restricted for AppLovin SDK, which is important for Google Play's child policies.

Syntax

applovin.setIsAgeRestrictedUser( shouldAgeRestrictUser )
shouldAgeRestrictUser (required)

Boolean. If the user is underage, please set the following flag to true, otherwise set it to false. The default value is false.

Example

local applovin = require( "plugin.applovin" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Set age restriction
        applovin.setIsAgeRestrictedUser( true )
    end
end

-- Initialize the AppLovin plugin
applovin.init( adListener, { sdkKey="YOUR_SDK_KEY" } )