Banner条幅广告

SDK 6.5以上才支持Banner广告。Banner采用移动广告行业的标准样式,支持320 x 50, 300 x 50 or 728 x 90 (平板电脑)

请求广告

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


NSError* error;
VungleSDK* sdk = [VungleSDK sharedSDK];
if (![sdk loadPlacementWithID:@"YOUR_BANNER_PLACEMENT_ID" withSize:VungleAdSizeBanner error:&error]) {
    if (error) {
        NSLog(@"Error occurred when loading placement: %@", error);
    }
}

播放广告


@interface ViewController ()
@property (nonatomic) UIView *bannerContainer;
@end

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

关闭广告

VungleSDK* sdk = [VungleSDK sharedSDK];
[sdk finishedDisplayingAd];
Powered by Creativity Driven by Performance Sign Up Here

Questions?

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

这篇文章有帮助吗?