MREC

SDK 6.4以上才支持MREC广告。MREC采用移动广告行业的标准样式,长宽为300dp × 250dp。

注意

测试模式,无法测试MREC广告。请将应用在Vungle Dashboard中设置为有效模式。

请求广告

SDK发送广告请求,在服务器给填充后开始缓存视频广告素材

NSError* error;
VungleSDK* sdk = [VungleSDK sharedSDK];
[sdk loadPlacementWithID:"YOUR_MREC_PLACEMENT_ID" error:&error];

播放广告

private ConstraintLayout flexfeed_container;
private VungleNativeAd vungleNativeAd;
private View nativeAdView;

...
NSError *error;
NSDictionary *options = @{};
VungleSDK* sdk = [VungleSDK sharedSDK];
If (![sdk addAdViewToView:_mrecViewArea withOptions:options placementID:"YOUR_MREC_PLACEMENT_ID" error:&error]) {
    if (error) 
    {
        NSLog(@"Error encountered while playing an ad: %@", error);
    }
}

关闭广告

VungleSDK* sdk = [VungleSDK sharedSDK];
[sdk finishedDisplayingAd];
这篇文章有帮助吗?

Questions?

Need further assistance, feel free to reach out to us, we’re here to help!