loadAd method
加载广告
type 广告类型
request 广告请求参数
Implementation
@override
/// 加载广告
///
/// [type] 广告类型
/// [request] 广告请求参数
Future<String> loadAd(GromoreAdType type, GromoreAdRequest request) async {
final String? adId = await methodChannel.invokeMethod<String>('loadAd', {
'adType': type.value,
'request': request.toMap(),
});
if (adId == null || adId.isEmpty) {
throw PlatformException(
code: 'load_failed',
message: 'loadAd returned empty adId.',
);
}
return adId;
}