SimpleAdInitializer class

Simple ad initializer with smart loading

This class provides easy initialization methods for different app types and automatically loads only the ads that have IDs provided.

Constructors

SimpleAdInitializer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

addAdType({String? bannerAdUnitId, String? interstitialAdUnitId, String? rewardedAdUnitId, String? nativeAdUnitId}) Future<void>
Method to add more ad types later at runtime
initializeForContentApp({required String bannerAdUnitId, required String rewardedAdUnitId, String? nativeAdUnitId, List<String>? testDeviceIds}) Future<void>
Convenience method for content apps (banner + rewarded)
initializeForGameApp({required String interstitialAdUnitId, required String rewardedAdUnitId, String? bannerAdUnitId, List<String>? testDeviceIds}) Future<void>
Convenience method for games (interstitial + rewarded)
initializeForRewardApp({required String rewardedAdUnitId, String? interstitialAdUnitId, List<String>? testDeviceIds, dynamic onAdError(String)?, dynamic onAdLoaded(String)?}) Future<void>
Convenience method for reward apps (most common use case)
initializeWithYourAdIds({String? rewardedAdUnitId, String? bannerAdUnitId, String? interstitialAdUnitId, String? nativeAdUnitId, List<String>? testDeviceIds, dynamic onAdError(String)?, dynamic onAdLoaded(String)?, dynamic onAdShown(String)?, dynamic onAdClosed(String)?}) Future<void>
Initialize with your custom ad IDs - only loads ads that have IDs provided