SwipeableInterstitialSignalRequest.Builder

@ExperimentalApi
public final class SwipeableInterstitialSignalRequest.Builder implements SwipeableInterstitialRequest.Builder


A builder class for creating SwipeableInterstitialSignalRequest.

Summary

Public constructors

Builder(@NonNull String signalType)

Gets a Builder for SwipeableInterstitialSignalRequest.

Public methods

final @NonNull SwipeableInterstitialSignalRequest.Builder

Sets a slot-level ad category exclusion label.

final @NonNull SwipeableInterstitialSignalRequest.Builder

Adds a keyword for targeting purposes.

final @NonNull SwipeableInterstitialSignalRequest

Constructs a SwipeableInterstitialSignalRequest with the specified attributes.

@NonNull SwipeableInterstitialSignalRequest.Builder
@CanIgnoreReturnValue
enableCustomClickSwipeGesture(
    @NonNull NativeAd.SwipeGestureDirection customClickSwipeGestureDirection,
    boolean customClickSwipeGestureTapsAllowed
)

Enables swipes as a custom click gesture.

final @NonNull SwipeableInterstitialSignalRequest.Builder

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

final @NonNull SwipeableInterstitialSignalRequest.Builder

Adds a custom targeting parameter.

final @NonNull SwipeableInterstitialSignalRequest.Builder

Adds a custom targeting parameter with multiple values.

@NonNull SwipeableInterstitialSignalRequest.Builder
@CanIgnoreReturnValue
setAdSize(int width, int height)

Sets the size of the ad.

final @NonNull SwipeableInterstitialSignalRequest.Builder

Sets the ad unit ID.

final @NonNull SwipeableInterstitialSignalRequest.Builder

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

final @NonNull SwipeableInterstitialSignalRequest.Builder

Set extra parameters to pass to AdMob or Ad Manager.

@NonNull SwipeableInterstitialSignalRequest.Builder
@CanIgnoreReturnValue
setMaxScreenHoldDurationSeconds(int maxScreenHoldDurationSeconds)

Specifies the maximum duration (in seconds) the app commits to holding the ad on screen before it is eligible for dismissal.

final @NonNull SwipeableInterstitialSignalRequest.Builder

Sets URLs representing web content near an ad.

final @NonNull SwipeableInterstitialSignalRequest.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.

final @NonNull SwipeableInterstitialSignalRequest.Builder

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

final @NonNull SwipeableInterstitialSignalRequest.Builder

Instructs the SDK to not collect bidding signals or execute waterfall elements for adapters that have not yet successfully initialized.

Public constructors

Builder

public Builder(@NonNull String signalType)

Gets a Builder for SwipeableInterstitialSignalRequest.

Public methods

addCategoryExclusion

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder addCategoryExclusion(@NonNull String categoryExclusion)

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
public final @NonNull SwipeableInterstitialSignalRequest.Builder addKeyword(@NonNull String keyword)

Adds a keyword for targeting purposes.

build

public final @NonNull SwipeableInterstitialSignalRequest build()

Constructs a SwipeableInterstitialSignalRequest with the specified attributes.

enableCustomClickSwipeGesture

@CanIgnoreReturnValue
public @NonNull SwipeableInterstitialSignalRequest.Builder enableCustomClickSwipeGesture(
    @NonNull NativeAd.SwipeGestureDirection customClickSwipeGestureDirection,
    boolean customClickSwipeGestureTapsAllowed
)

Enables swipes as a custom click gesture.

Available for allowlisted publishers only. These settings will be ignored for publishers not allowlisted.

Parameters
@NonNull NativeAd.SwipeGestureDirection customClickSwipeGestureDirection

The SwipeGestureDirection to be counted as a click.

boolean customClickSwipeGestureTapsAllowed

Whether taps should still be allowed as clicks. Default is true.

putAdSourceExtrasBundle

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder putAdSourceExtrasBundle(
    @NonNull Class<@NonNull MediationExtrasReceiver> adapterClass,
    @NonNull Bundle adSourceExtras
)

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

Parameters
@NonNull Class<@NonNull MediationExtrasReceiver> adapterClass

The Class of the adapter that should receive extras.

@NonNull Bundle adSourceExtras

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

putCustomTargeting

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder putCustomTargeting(@NonNull String key, @NonNull String value)

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
public final @NonNull SwipeableInterstitialSignalRequest.Builder putCustomTargeting(
    @NonNull String key,
    @NonNull List<@NonNull String> values
)

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.

setAdSize

@CanIgnoreReturnValue
public @NonNull SwipeableInterstitialSignalRequest.Builder setAdSize(int width, int height)

Sets the size of the ad.

If this method is not called, the ad defaults to full-screen size dimensions.

Parameters
int width

The width of the requested ad in dp.

int height

The height of the requested ad in dp.

setAdUnitId

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder setAdUnitId(@NonNull String adUnitId)

Sets the ad unit ID.

setContentUrl

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder setContentUrl(@NonNull String contentUrl)

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
IllegalArgumentException

If contentUrl is empty.

setGoogleExtrasBundle

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder setGoogleExtrasBundle(@NonNull Bundle extraBundle)

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

Parameters
@NonNull Bundle extraBundle

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

setMaxScreenHoldDurationSeconds

@CanIgnoreReturnValue
public @NonNull SwipeableInterstitialSignalRequest.Builder setMaxScreenHoldDurationSeconds(int maxScreenHoldDurationSeconds)

Specifies the maximum duration (in seconds) the app commits to holding the ad on screen before it is eligible for dismissal. The SDK only returns ads with a hold requirement that is less than or equal to this value. Defaults to 0.

Parameters
int maxScreenHoldDurationSeconds

The maximum screen hold duration in seconds. Must be positive.

setNeighboringContentUrls

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder setNeighboringContentUrls(
    @NonNull Set<@NonNull String> neighboringContentUrls
)

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
@NonNull Set<@NonNull String> neighboringContentUrls

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

setPublisherProvidedId

@CanIgnoreReturnValue
public final @NonNull SwipeableInterstitialSignalRequest.Builder setPublisherProvidedId(@NonNull String publisherProvidedId)

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
public final @NonNull SwipeableInterstitialSignalRequest.Builder setRequestAgent(@NonNull String requestAgent)

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.

skipUninitializedAdapters

@ExperimentalApi
public final @NonNull SwipeableInterstitialSignalRequest.Builder skipUninitializedAdapters()

Instructs the SDK to not collect bidding signals or execute waterfall elements for adapters that have not yet successfully initialized.

Protected methods

getAdSourceExtrasBundles

protected final @NonNull Map<@NonNull String, @NonNull Bundle> getAdSourceExtrasBundles()

getAdUnitId

protected final String getAdUnitId()

The ad unit ID.

getCategoryExclusions

protected final @NonNull Set<@NonNull String> getCategoryExclusions()

getContentUrl

protected final String getContentUrl()

getCustomTargeting

protected final @NonNull Map<@NonNull String, @NonNull String> getCustomTargeting()

getGoogleExtrasBundle

protected final @NonNull Bundle getGoogleExtrasBundle()

getKeywords

protected final @NonNull HashSet<@NonNull String> getKeywords()

getNeighboringContentUrls

protected final @NonNull HashSet<@NonNull String> getNeighboringContentUrls()

getPlacementId

protected final long getPlacementId()

getPublisherProvidedId

protected final String getPublisherProvidedId()

getRequestAgent

protected final String getRequestAgent()

getSignalType

protected final @NonNull String getSignalType()

getSkipUninitializedAdapters

protected final boolean getSkipUninitializedAdapters()

setAdUnitId

protected final void setAdUnitId(String adUnitId)

The ad unit ID.