AdRequestConfig class

Configuration for ad requests.

Use this class to customize individual ad requests with targeting information and preferences.

Example:

final config = AdRequestConfig(
  keywords: ['games', 'sports'],
  nonPersonalizedAds: true,
);
await ads.preloadInterstitialAd(
  adUnitId: 'ad-unit-id',
  requestConfig: config,
);

Constructors

AdRequestConfig({List<String>? keywords, String? contentUrl, List<String>? testDevices, bool? nonPersonalizedAds})
const

Properties

contentUrl String?
URL of the content being displayed.
final
hashCode int
The hash code for this object.
no setterinherited
keywords List<String>?
Keywords for ad targeting.
final
nonPersonalizedAds bool?
Whether to request non-personalized ads.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
testDevices List<String>?
Test device IDs for this specific request.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts this configuration to a map for platform channel communication.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited