mobfox / MobFox-iOS-SDK

Apache License 2.0
15 stars 12 forks source link

No banner test ads unless exactly 320x50 #50

Open andre-arsenault opened 6 years ago

andre-arsenault commented 6 years ago

This issue occurs when using test ads with the default inventory hash of fe96717d9875b9da4339ea5367eff1ec.

Current behaviour

Unless a CGRect whose width and height are exactly 320 and 50 respectively is passed to [MobFoxAd:init:withFrame], the following error will be returned:

MobFoxAdDidFailToReceiveAdWithError: Error Domain=no ad could be found for this request (no fill) Code=0 "(null)"

A CGRect of exactly 320x50 will result in test ads being returned correctly.

Expected behaviour:

The ad request parameters documentation shows that there is a parameter called adpsace_strict which is set to 0 by default.

Test ads should behave as the documentation suggests. If larger dimensions are passed, the service should return any available ads up to and including the given ad size.

Example

Running on an iPhone 7 Plus device with a screen width of 414px, I pass in a rect of 414 width and 50 height to [MobFoxAd:init:withFrame]. No ads are returned and the 'no fill' error referenced above is thrown.

Instead I would expect at least the default 320x50 test banner ad to be returned, if there are no natively-sized test banners for this device's dimensions.

Also, if a smaller ad is returned, I would expect for it to be centered within the rect specified.

nabriski commented 6 years ago

Hi,

Thanks. We're already aware of that and through adapters (MoPub, AdMob) this already works. You'll see this fixed in the next few versions. Will update this issue accordingly.

andre-arsenault commented 6 years ago

Great, thanks!

Two follow-ups:

  1. Is the problem happening for non-test ads as well or is this issue specific to test ads?
  2. If a smaller banner is returned, will it be centered in the rect specified?
nabriski commented 6 years ago

Hi,

  1. It's for all ads as banner demand is usually 320x50. If you send a 414x50 request the fill rate will be much lower (but above zero).
  2. Yes, the correction for this situation is to ask for a 320x50 ad and center it nicely on the 414x50 space. This is what we do in the adapters.
andre-arsenault commented 6 years ago
  1. Surely the fill rate for 414x50 would be higher? Since it will serve both 414x50 and 320x50 ads? I suppose currently it will be much lower, as it will only return 414x50 ads.

Cheers, looking forward to the update to support different-sized ad areas properly.

nabriski commented 6 years ago

Yes, I guess it will.

nabriski commented 6 years ago

We've unified the code for direct calls and adapter calls so it should work now.