Native ads allow you to make additional customizations using the
object. This guide shows you how to use
The last function included in the creation of the
AdLoaderabove is another optional method,
.withNativeAdOptions(new NativeAdOptions.Builder() // Methods in the NativeAdOptions.Builder class can be // used here to specify individual options settings. .build() )
.withNativeAdOptions(NativeAdOptions.Builder() // Methods in the NativeAdOptions.Builder class can be // used here to specify individual options settings. .build() )
Image assets for native ads are returned via instances of
NativeAd.Image, which holds a
Uri. If this option is set to false (which is the default), the SDK fetches image assets automatically and populates both the
Urifor you. If it's set to true, however, the SDK instead populates just the
Urifield, allowing you to download the actual images at your discretion.
Some creatives have multiple available images to match different device orientations. Calling this method with one of the
NativeAdOptionsorientation constants (
ORIENTATION_ANY) requests images for a particular orientation. If this method is not called, the default value of
Some image assets contain a series of images rather than just one. By setting this value to true, your app indicates that it's prepared to display all the images for any assets that have more than one. By setting it to false (default) your app instructs the SDK to provide just the first image for any assets that contain a series.
withNativeAdOptionsis not called at all when creating an
AdLoader, the default value for each option is used.
The AdChoices overlay is set to the top right corner by default. Apps can change which corner this overlay is rendered in by setting this property to one of the following:
Apps can use this method to set options for video assets returned as part of a native ad. For more information, see the Native Video section of the native advanced guide.