I have been struggling with following problem quite a while : I have swift project that has autolayout on I am working with any height, any width. I have adbanner whos height is 50 and side are pinned to super view.
when I run I get this error :
Unable to set adSize property. Not enough space to show ad with custom size, {600, 50}. Please use a size the fits the current screen bounds of {320, 568}.
I read quite a few post here, either they are not using autolayout or for android : AdMob Banner Size for retina display iphone
changing admob banner size dynamically
How to create an admob banner programmatically?
How to specify adUnitId programmatically for AdMob?
This google link which was for android again, was somewhat helpful to shape my thinking https://developers.google.com/mobile-ads-sdk/docs/dfp/android/banner?hl=en
After reading a lot loosly related stuff. I write this line:
adBannerView.adSize = kGADAdSizeBanner
Which should solved the problem as I am on iPhone and Banner is 320x50 I tried kGADAdSizeSmartBannerPortrait too
But I am still seeing the error, and ad is not being displayed I thought it might be because of as its testing device I did following too ...
if debug{ var devices: [String] = ["fe2b6df035b7b0729ae7d33cf35d2aa9"] GADRequest().testDevices = devices } else{ adBannerView.loadRequest(GADRequest()) }
But No luck. Anyone have some pointers for me.