AdUnitId class
Platform-specific ad unit ID pair.
Holds separate ad unit IDs for Android and iOS. In debug builds, the resolved getter automatically substitutes Google's official test ad IDs so that real ads are never served during development.
final bannerId = AdUnitId(
android: 'ca-app-pub-xxxxx/banner-android',
ios: 'ca-app-pub-xxxxx/banner-ios',
);
// In debug: returns Google test ID
// In release: returns your production ID
print(bannerId.resolved);
Constructors
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolved(
{AdType adType = AdType.banner}) → String - Returns the ad unit ID for the current platform.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- testAppOpenAndroid → const String
- Google's official test app-open ad ID for Android.
- testAppOpenIos → const String
- Google's official test app-open ad ID for iOS.
- testBannerAndroid → const String
- Google's official test banner ad ID for Android.
- testBannerIos → const String
- Google's official test banner ad ID for iOS.
- testInterstitialAndroid → const String
- Google's official test interstitial ad ID for Android.
- testInterstitialIos → const String
- Google's official test interstitial ad ID for iOS.
- testRewardedAndroid → const String
- Google's official test rewarded ad ID for Android.
- testRewardedIos → const String
- Google's official test rewarded ad ID for iOS.