iphone - iOS - 如何在 LeadBolt sdk 中设置广告刷新率

标签 iphone ios ads leadbolt

当我的应用加载时,它在整个 session 中显示相同的横幅广告。有没有一种方法可以循环显示新广告,例如刷新当前横幅以显示下一个广告?这正在扼杀我的印象和转化。正如一则广告所示,整个 session 实际上不会对用户产生太多吸引力。我通过阅读文档知道 loadAd() 与它有关,但我似乎无法弄清楚如何实际实现该时间间隔。这是我的代码,说明在我显示横幅的 View 中使用 Leadbolt 所发生的情况。这是 - (void)viewDidLoad 的全部部分,我只是省略了与广告无关的所有其他内容。

    overlay = [[UIWebView alloc] initWithFrame:CGRectZero];
    titleBar = [[UIToolbar alloc] initWithFrame:CGRectZero];
    footerBar = [[UIToolbar alloc] initWithFrame:CGRectZero];
    clickTitleBar = [[UIToolbar alloc] initWithFrame:CGRectZero];
    clickFooterBar = [[UIToolbar alloc] initWithFrame:CGRectZero];
    mask = [[UIView alloc] initWithFrame:CGRectZero];

    [self.view insertSubview:mask atIndex:2];
    [self.view insertSubview:clickTitleBar atIndex:3];
    [self.view insertSubview:clickFooterBar atIndex:4];
    [self.view insertSubview:titleBar atIndex:5];
    [self.view insertSubview:footerBar atIndex:6];
    [self.view insertSubview:overlay atIndex:7];
    overlay.delegate = overlayController;

    //initialize the overlayController 
    overlayController  = [[LeadboltOverlay alloc] init];

    [overlayController setSectionid:@"MY AD #"];
    [overlayController setAdWebView:self.overlay];
    [overlayController setCloseBar:self.titleBar];
    [overlayController setFooterBar:self.footerBar];
    [overlayController setClickCloseBar:self.clickTitleBar];
    [overlayController setClickFooterBar:self.clickFooterBar];
    [overlayController setLocationControl:@"0"];
    [overlayController setMask:self.mask];

    ///////This part here?///////
    [overlayController loadAd];
    /////////////////////////////

    overlay.delegate = overlayController;

    self.stsTimer = [NSTimer timerWithTimeInterval:3.0 target:self selector:@selector(checkCompleted) userInfo:nil repeats:YES];
    [[NSRunLoop currentRunLoop] addTimer:self.stsTimer forMode:NSDefaultRunLoopMode];

最佳答案

要刷新广告(可能每分钟或每次 UI 中出现事件时),您只需在 UIWebView 中设置一个 HTML 横幅,并在每次您希望显示新广告时调用 myWebview reload]。

不建议重复[overlayController loadAd],因为它可能会导致内存管理问题。

关于iphone - iOS - 如何在 LeadBolt sdk 中设置广告刷新率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9968891/

相关文章:

iphone - 使用pushViewController时UINavigationController变成null

javascript - 如何重新托管 KendoUI 手机模拟器(包括示例)

ios - UIView 内的 OpenGLView

node.js - 在 Sails Express Node js 中如何在请求的页面加载时显示广告

ios - 有时无法加载激励视频广告

iphone - 如果 UITableViewCell 不可见则为 nil

iphone - CoreData 中的重复名称?

ios - 3dtouch to present(peek without pop) UIView like contacts app

ios - 在表格 View 中使用两个不同的单元格

algorithm - 展示广告的智能算法