callback method

dynamic callback(
  1. TPInterActiveAdListener listener,
  2. String adUnitId,
  3. String method,
  4. Map arguments,
)

Implementation

callback(TPInterActiveAdListener listener, String adUnitId, String method,
    Map arguments) {
  Map adInfo = {};
  if (arguments.containsKey("adInfo")) {
    adInfo = arguments['adInfo'];
  }
  Map error = {};
  if (arguments.containsKey("adError")) {
    error = arguments['adError'];
  }
  if (method == 'interactive_loaded') {
    listener.onAdLoaded(adUnitId, adInfo);
  } else if (method == 'interactive_loadFailed') {
    listener.onAdLoadFailed(adUnitId, error);
  } else if (method == 'interactive_impression') {
    listener.onAdImpression(adUnitId, adInfo);
  } else if (method == 'interactive_showFailed') {
    listener.onAdShowFailed(adUnitId, adInfo, error);
  } else if (method == 'interactive_clicked') {
    listener.onAdClicked(adUnitId, adInfo);
  } else if (method == 'interactive_closed') {
    listener.onAdClosed(adUnitId, adInfo);
  } else if (method == 'interactive_startLoad') {
    listener.onAdStartLoad!(adUnitId, adInfo);
  } else if (method == 'interactive_oneLayerStartLoad') {
    listener.oneLayerStartLoad!(adUnitId, adInfo);
  } else if (method == 'interactive_bidStart') {
    listener.onBiddingStart!(adUnitId, adInfo);
  } else if (method == 'interactive_bidEnd') {
    listener.onBiddingEnd!(adUnitId, adInfo, error);
  } else if (method == 'interactive_isLoading') {
    listener.onAdIsLoading!(adUnitId);
  } else if (method == 'interactive_oneLayerLoaded') {
    listener.oneLayerLoaded!(adUnitId, adInfo);
  } else if (method == 'interactive_oneLayerLoadedFail') {
    listener.oneLayerLoadFailed(adUnitId, adInfo, error);
  } else if (method == 'interactive_allLoaded') {
    bool isSuccess = arguments["success"];
    listener.onAdAllLoaded!(adUnitId, isSuccess);
  } else if (method == 'interactive_playStart') {
    listener.onVideoPlayStart!(adUnitId, adInfo);
  } else if (method == 'interactive_playEnd') {
    listener.onVideoPlayEnd!(adUnitId, adInfo);
  }
}