问题描述
在横幅广告单元上使用提取要求时,我遇到问题。状态代码始终会在本地iOS模拟器上返回“ Prebid Server未退还出价”测试。
我已经通过更改一些配置设置而搞砸了,并得到了其他状态代码消息。我只是想成功地进行健全性检查并确保我目前没有做错任何事情。
func fetchBannerBid() {
guard let adView = self.adView,!isInterstitial else {
return
}
let chosenAdUnit : BannerAdUnit
if adUnitId == Constant.SEAppNexusBannerAdUnitID {
chosenAdUnit = BannerAdUnit(configId: Constant.SEAppNexusBannerConfigID,size: CGSize(width: 320,height: 50))
chosenAdUnit.pbAdSlot = Constant.SEAppNexusBannerAdUnitID
}
else {
chosenAdUnit = BannerAdUnit(configId: Constant.SEAppNexusMediumConfigID,height: 250))
chosenAdUnit.pbAdSlot = Constant.SEAppNexusMediumRectAdUnitID
}
// Do any additional setup after loading the view,typically from a nib.
chosenAdUnit.fetchDemand { [weak self] (resultCode: ResultCode,targetingDict: [String : String]?) in
guard let `self` = self else { return }
self.fetchStartDate = Date()
print("Testing appnexus: result code = \(resultCode.name())")
if let fetchStartDate = self.fetchStartDate {
let loadTime = String(Date().timeIntervalSince(fetchStartDate))
self.delegate?.bidderDidFinish(name: self.name,keywordsToAdd: [],parsedBid: nil,loadTime: loadTime)
}
}
解决方法
您可以使用
//pass AdServer object which will be modified internally
adUnit.fetchDemand(adObject:)
//you are responsible for setting targetingDict into AdServer object
adUnit.fetchDemand(resultCode: targetingDict:)
无论如何,您都应至少从PrebidServer获得一些结果,才能将其传递到AdServer对象