applovinMax.setHasUserConsent()

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

Overview

AppLovin SDK requires that publishers set a flag indicating whether the user has provided the publisher opt-in consent for the collection and use of personal data.

Syntax

applovinMax.setHasUserConsent( hasUserConsent )
hasUserConsent (required)

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

Example

local applovinMax = require( "plugin.applovinMax" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        applovinMax.setHasUserConsent( true )
    end
end

-- Initialize the AppLovin plugin

applovinMax.init( adListener )