Type Function Return value none Revision Release 2025.3721 Keywords ads, advertising, StartApp, setUserConsent See also startapp.*
startapp.setUserConsent() indicates specific type of consent from a given user.
Data protection and privacy regulations may require you and your company to obtain consent from users before processing personal data and to honor users’ requests for how you use their personal data. StartApp is required to record these consent logs and thus we have provided you with an API which enables you to send this consent from your user to StartApp. Based on consent signals that you send, StartApp uses the data to target the most relevant campaigns to your users. Without receiving this consent we will not be able to send targeted ads (but rather non-targeted ads)
startapp.setUserConsent( params )
Table. Table containing user-consent values — see the next section for details.
The params table includes parameters for sending user consent.
String. type of consent. For example "ACCESS_FINE_LOCATION" for ACCESS_FINE_LOCATION permission.
Number. the specific time a consent / dissent was given by the user. Use os.time().
Boolean. true indicates consumer consent, false indicates consumer dissent.
local startapp = require( "plugin.startapp" )
-- StartApp listener function
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
print( event.provider )
end
end
-- Initialize the StartApp plugin
startapp.init( adListener, { appId="Your App ID", enableReturnAds = true } )
-- Sometime later
startapp.setUserConsent({
consentType = "ACCESS_FINE_LOCATION",
timestamp = os.time(),
enabled = true
})