IconSignalRequest.Builder

class IconSignalRequest.Builder


A builder for creating IconSignalRequests.

Summary

Public constructors

Builder(signalType: String)

Gets a Builder for an icon ad signal request.

Public functions

IconSignalRequest.Builder

Sets a slot-level ad category exclusion label.

IconSignalRequest.Builder

Adds a keyword for targeting purposes.

IconSignalRequest

Constructs an IconSignalRequest with the specified attributes.

open IconSignalRequest.Builder

Indicates whether downloading image assets should be disabled by the SDK when loading an ad.

IconSignalRequest.Builder
@CanIgnoreReturnValue
putAdSourceExtrasBundle(
    adapterClass: Class<MediationExtrasReceiver>,
    adSourceExtras: Bundle
)

Adds extra parameters to pass to a specific ad source adapter.

IconSignalRequest.Builder

Adds a custom targeting parameter.

IconSignalRequest.Builder

Adds a custom targeting parameter with multiple values.

open IconSignalRequest.Builder

Sets the placement of the AdChoices icon (if available for the returned ad).

IconSignalRequest.Builder

Sets the ad unit ID.

IconSignalRequest.Builder

Sets the content URL for a web site whose content matches the app's primary content.

open IconSignalRequest.Builder
setCorrelator(correlator: String)

Sets a correlator for this ad request.

IconSignalRequest.Builder

Set extra parameters to pass to AdMob or Ad Manager.

open IconSignalRequest.Builder

Sets the IconAdPlacement for the request.

IconSignalRequest.Builder

Sets URLs representing web content near an ad.

IconSignalRequest.Builder

Sets an identifier for use in frequency capping, audience segmentation and targeting, sequential ad rotation, and other audience-based ad delivery controls across devices.

IconSignalRequest.Builder

Sets the request agent string to identify the ad request's origin.

Public constructors

Builder

Builder(signalType: String)

Gets a Builder for an icon ad signal request.

Public functions

addCategoryExclusion

@CanIgnoreReturnValue
fun addCategoryExclusion(categoryExclusion: String): IconSignalRequest.Builder

Sets a slot-level ad category exclusion label.

This feature is only applicable for Ad Manager ad requests. Any category exclusions will be ignored on AdMob requests.

addKeyword

@CanIgnoreReturnValue
fun addKeyword(keyword: String): IconSignalRequest.Builder

Adds a keyword for targeting purposes.

build

fun build(): IconSignalRequest

Constructs an IconSignalRequest with the specified attributes.

disableImageDownloading

open fun disableImageDownloading(): IconSignalRequest.Builder

Indicates whether downloading image assets should be disabled by the SDK when loading an ad. If called, the SDK will not download image assets and instead return an Image with just the URI and Scale properties populated. By default, the SDK will automatically download image assets and return a Image with all three properties (URI, Scale, and Drawable) populated.

putAdSourceExtrasBundle

@CanIgnoreReturnValue
fun putAdSourceExtrasBundle(
    adapterClass: Class<MediationExtrasReceiver>,
    adSourceExtras: Bundle
): IconSignalRequest.Builder

Adds extra parameters to pass to a specific ad source adapter.

Parameters
adapterClass: Class<MediationExtrasReceiver>

The Class of the adapter that should receive extras.

adSourceExtras: Bundle

A Bundle of extra information to pass to a mediation adapter.

putCustomTargeting

@CanIgnoreReturnValue
fun putCustomTargeting(key: String, value: String): IconSignalRequest.Builder

Adds a custom targeting parameter. Calling this a second time with the same key will overwrite the old values.

This feature is only applicable for Ad Manager ad requests. Any custom targeting will be ignored on AdMob requests.

putCustomTargeting

@CanIgnoreReturnValue
fun putCustomTargeting(key: String, values: List<String>): IconSignalRequest.Builder

Adds a custom targeting parameter with multiple values. Calling this a second time with the same key will overwrite the old values.

This feature is only applicable for Ad Manager ad requests. AdMob requests currently ignore custom targeting.

setAdChoicesPlacement

open fun setAdChoicesPlacement(adChoicesPlacement: AdChoicesPlacement): IconSignalRequest.Builder

Sets the placement of the AdChoices icon (if available for the returned ad). The default value is AdChoicesPlacement.TOP_RIGHT.

setAdUnitId

@CanIgnoreReturnValue
fun setAdUnitId(adUnitId: String): IconSignalRequest.Builder

Sets the ad unit ID.

setContentUrl

@CanIgnoreReturnValue
fun setContentUrl(contentUrl: String): IconSignalRequest.Builder

Sets the content URL for a web site whose content matches the app's primary content. This web site content is used for targeting and brand safety purposes.

Throws
kotlin.IllegalArgumentException

If contentUrl is empty.

setCorrelator

open fun setCorrelator(correlator: String): IconSignalRequest.Builder

Sets a correlator for this ad request. Set the same correlator for IconAdRequests that should be grouped together. It is recommended that icon ads that will be displayed together are requested with the same correlator.

setGoogleExtrasBundle

@CanIgnoreReturnValue
fun setGoogleExtrasBundle(extraBundle: Bundle): IconSignalRequest.Builder

Set extra parameters to pass to AdMob or Ad Manager. Calling this a second time will overwrite the old values.

Parameters
extraBundle: Bundle

A Bundle of extra information to pass to AdMob or Ad Manager.

setIconAdPlacement

open fun setIconAdPlacement(placement: IconAdPlacement): IconSignalRequest.Builder

Sets the IconAdPlacement for the request. If none is set, IconAdPlacement.UNSPECIFIED will be used.

setNeighboringContentUrls

@CanIgnoreReturnValue
fun setNeighboringContentUrls(neighboringContentUrls: Set<String>): IconSignalRequest.Builder

Sets URLs representing web content near an ad. Promotes brand safety and allows displayed ads to have an app level rating (MA, T, PG, etc) that is more appropriate to neighboring content.

Parameters
neighboringContentUrls: Set<String>

The set of neighboring content URLs to be attached to the existing neighboring content URLs.

setPublisherProvidedId

@CanIgnoreReturnValue
fun setPublisherProvidedId(publisherProvidedId: String): IconSignalRequest.Builder

Sets an identifier for use in frequency capping, audience segmentation and targeting, sequential ad rotation, and other audience-based ad delivery controls across devices.

This feature is only applicable for Ad Manager ad requests. Any ID will be ignored on AdMob requests.

setRequestAgent

@CanIgnoreReturnValue
fun setRequestAgent(requestAgent: String): IconSignalRequest.Builder

Sets the request agent string to identify the ad request's origin. Third party libraries that implement the Mobile Ads SDK on behalf of publishers should call this method to denote the platform from which the ad request originated.

Protected functions

getContentUrl

protected fun getContentUrl(): String?

getGoogleExtrasBundle

protected fun getGoogleExtrasBundle(): Bundle

getPlacementId

protected fun getPlacementId(): Long

getPublisherProvidedId

protected fun getPublisherProvidedId(): String?

getRequestAgent

protected fun getRequestAgent(): String?

self

protected open fun self(): IconSignalRequest.Builder

Protected properties

adSourceExtrasBundles

protected val adSourceExtrasBundlesMutableMap<StringBundle>

adUnitId

protected var adUnitIdString?

The ad unit ID.

categoryExclusions

protected val categoryExclusionsMutableSet<String>

customTargeting

protected val customTargetingMutableMap<StringString>

keywords

protected val keywordsHashSet<String>

neighboringContentUrls

protected val neighboringContentUrlsHashSet<String>

signalType

protected val signalTypeString