[英]Migrating iOS prebid mobile from 0.53 to 1.82
在橫幅廣告單元上使用獲取需求時遇到問題。 在本地 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, 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)
}
}
您可以使用
//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 對象
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.