setGlobalParameters

abstract fun setGlobalParameters(vararg parameters: GlobalParameter<*>)

A method for setting common global parameters for AdRequest, TagRequest, and TrackingRequest.

Some parameters are designed to be passed in all requests, not just individual ones. To avoid duplicating code when creating AdRequest, TagRequest and TrackingRequest, you can pass all parameters via AdServiceProvider.configure using the globalParameters parameter.

In case you need to change them over time, SDK provide setGlobalParameters method, which will modify these parameters:

// Set parameter
adService.setGlobalParameters(
GlobalParameter(
GlobalParameters::accessMode,
AccessMode.OPT_IN
)
)

// Clear parameter
adService.removeGlobalParameter(GlobalParameters::accessMode)

A list of all global parameters can be found in the documentation for GlobalParameters.

Parameters

parameters

One or more GlobalParameter representing mutable parameters within GlobalParameters and their values to be set.

See also