I am having an issue when using the fetch demand on a banner ad unit. The status code always returns "Prebid Server did not return bids" testing on a iOS simulator locally.
I've messed around by changing some config settings and got other status code messages. I just want to successfully get a bid for sanity check and ensure I'm currently doing nothing wrong.
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)
}
}
you can use
In any case you should have at least some result from PrebidServer to pass it into AdServer object