NativeAd.fromAdManagerRequest constructor
NativeAd.fromAdManagerRequest({
- required String adUnitId,
- String? factoryId,
- required NativeAdListener listener,
- required AdManagerAdRequest? adManagerRequest,
- NativeAdOptions? nativeAdOptions,
- Map<
String, Object> ? customOptions, - NativeTemplateStyle? nativeTemplateStyle,
Creates a NativeAd with Ad Manager.
A valid adUnitId
, nonnull listener
, nonnull adManagerRequest
, and
either factoryId
or nativeTemplateStyle
is required.
Use nativeAdOptions
to customize the native ad request.
Use customOptions
to pass data to your native ad factory.
Implementation
NativeAd.fromAdManagerRequest({
required String adUnitId,
this.factoryId,
required this.listener,
required this.adManagerRequest,
this.nativeAdOptions,
this.customOptions,
this.nativeTemplateStyle,
}) : request = null,
assert(adManagerRequest != null),
assert(nativeTemplateStyle != null || factoryId != null),
super(adUnitId: adUnitId, listener: listener);