addAdId method

void addAdId(
  1. String adId,
  2. AdCallback callback
)

Registers adId to watch for ad-ready events.

callback is invoked on the Dart side when the native SDK signals that the ad slot is ready. Calling this with an already-registered adId updates the callback.

Implementation

void addAdId(String adId, AdCallback callback) {
  _callbacks[adId] = callback;
  if (!_adIds.contains(adId)) {
    _adIds.add(adId);
  } else {
    Logger.w("$adId already added, update callback");
  }
}