Native Ad Options - bdlukaa/native_admob_flutter GitHub Wiki
Native ads allow you to make additional customizations using the NativeAdOptions object. This guide shows you how to use NativeAdOptions.
Setting options
Define NativeAdOptions in NativeAd:
NativeAd(
...,
options: NativeAdOptions(
...
),
)
By default, each time options is changed, the ad will be reloaded. To disable this behavior, set reloadWhenOptionsChange to false.
Options
adChoichesPlacement
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:
ADCHOICES_TOP_LEFTADCHOICES_TOP_RIGHTADCHOICES_BOTTOM_RIGHTADCHOICES_BOTTOM_LEFT
mediaAspectRatio
This sets the aspect ratio for image or video to be returned for the native ad. Setting it to one of the following constants will cause only ads with media of the specified aspect ratio to be returned:
NATIVE_MEDIA_ASPECT_RATIO_LANDSCAPENATIVE_MEDIA_ASPECT_RATIO_PORTRAITNATIVE_MEDIA_ASPECT_RATIO_SQUARENATIVE_MEDIA_ASPECT_RATIO_ANY
If it is not set, ads with any aspect ratio will be returned.
Using with the controller
You can use NativeAdOptions in the load() method:
controller.load(
options: NativeAdOptions(
...
),
);
| Next: Custom mute this ad |
|---|