createInterstitialAd static method
Create Interstitial Ad with remote config support
key Key to fetch remote config (expects string unit ID)
defaultUnitId Default unit ID if remote config fails
Returns DreamInterstitialAd instance (reused if already exists)
Implementation
static DreamInterstitialAd createInterstitialAd(
String key,
String defaultUnitId,
) {
// Check if instance already exists
final existingAd = _interstitialAdMap[key];
if (existingAd != null) {
return existingAd;
}
final config = _getFullScreenAdConfigFromRemoteConfig(key, defaultUnitId);
final interstitialAd = _createInterstitialAdByNetwork(key, config);
// Store instance in map for reuse
_interstitialAdMap[key] = interstitialAd;
return interstitialAd;
}