loadFeedAd method

Future<PangleAd> loadFeedAd({
  1. IOSFeedConfig? iOS,
  2. AndroidFeedConfig? android,
})

Request feed ad data.

iOS config for iOS android config for Android return loaded ad count.

Implementation

Future<PangleAd> loadFeedAd({
  IOSFeedConfig? iOS,
  AndroidFeedConfig? android,
}) async {
  Map<dynamic, dynamic>? result;
  if (Platform.isIOS && iOS != null) {
    result = await _methodChannel.invokeMapMethod<dynamic, dynamic>(
      'loadFeedAd',
      iOS.toJSON(),
    );
  } else if (Platform.isAndroid && android != null) {
    result = await _methodChannel.invokeMapMethod<dynamic, dynamic>(
      'loadFeedAd',
      android.toJSON(),
    );
  }
  if (result == null) {
    return PangleAd.empty();
  }
  return PangleAd.fromJsonMap(result);
}