我在横幅广告单元上使用fetch demand时遇到了一个问题。在本地的iOS模拟器上进行测试时,状态代码总是返回"Prebid服务器没有返回bids“。
我更改了一些配置设置,得到了其他状态代码消息。我只想成功地获得一个健全的检查出价,并确保我目前没有做错任何事情。
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, size: CGSize(width: 320, 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)
}
}发布于 2020-10-22 03:34:15
您可以使用
//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对象中
https://stackoverflow.com/questions/64469395
复制相似问题