Type Function Return value none Revision Release 2025.3721 Keywords ads, advertising, AppLovin, setHasUserConsent See also applovin.init() applovin.load() applovin.isLoaded() applovin.setIsAgeRestrictedUser() applovin.*
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.
applovin.setHasUserConsent( hasUserConsent )
Boolean. If the user has consented, please set the following flag to true, otherwise set it to false. The default value is false.
local applovin = require( "plugin.applovin" )
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
-- Set user consention
applovin.setHasUserConsent( true )
end
end
-- Initialize the AppLovin plugin
applovin.init( adListener, { sdkKey="YOUR_SDK_KEY" } )