当我的应用加载时,它在整个 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/