eventAdImpressionTradPlusAdInfo method

void eventAdImpressionTradPlusAdInfo(
  1. Map<String, dynamic> json
)

Implementation

void eventAdImpressionTradPlusAdInfo(Map<String, dynamic> json) {
  Map<String, dynamic> transformedJson = {};

  if (Platform.isIOS) {
    transformedJson['revenue'] = json['ecpm'];
    transformedJson['ad_unit_id'] = json['adunit_id'];
    transformedJson['network_name'] = json['adNetworkName'];
    transformedJson['creative_id'] = json['creativeIdentifier'];
    transformedJson['revenue_precision'] = json['ecpm_precision'];
    transformedJson['format'] = json['placement_ad_type'];
    transformedJson['country'] = json['country_code'];
    transformedJson['ab_test'] = json['bucket_id'];
    transformedJson['segment'] = json['segment_id'];
    transformedJson['placement'] = json['adsource_placement_id'];
  } else if (Platform.isAndroid) {
    transformedJson['ad_unit_id'] = json['tpAdUnitId'];
    transformedJson['network_name'] = json['adSourceName'];
    transformedJson['revenue'] = json['ecpm'];
    transformedJson['revenue_precision'] = json['ecpmPrecision'];
    transformedJson['placement'] = json['adSourcePlacementId'];
    transformedJson['ab_test'] = json['bucketId'];
    transformedJson['segment'] = json['segmentId'];
    transformedJson['country'] = json['isoCode'];
    transformedJson['format'] = json['format'];
  }

  _channel.invokeMethod('eventAdImpressionTradPlus', transformedJson);
}