|Not enough space to show ad reported, but there is enough space on a large screen tablet||Neil Burlock||7/12/13 5:52 PM|
I've encountered a problem using the Unity plugin with MoPub on Android.
Despite testing my app on a Transformer Prime with a resolution of 1280x800 (in landscape only), I cannot get MoPub to display a tablet leaderboard sized AdMob ad.
The log reports that it is requesting the ad correctly, but it's trying to fit into a tiny view of the size expected for a phone:
Not enough space to show ad! Wants: <728, 90>, Has <320, 752>
If I switch the ad to phone size on MoPub's dashboard, it will display, but then it's tiny at such a high screen resolution.
|Re: Not enough space to show ad reported, but there is enough space on a large screen tablet||Neil Burlock||7/12/13 8:50 PM|
Looking into this further, the AdViewController buffers the ad size from the initial connection to AdMob (in AdViewController.configureUsingHttpResponse), and AdMob is saying that the ads are going to be 320x50.
Subsequent calls to AdMob to retrieve ads can send through something that's a different size to what AdViewController now thinks the ad size is.
I made use of an unused property in AdViewController, mResponseString, and put a copy of the response string into it, so it could be accessed from the Unity plugin (isn't this what should be happening anyway?). When a banner ad arrives, the Unity plugin will now ignore the ad size specified by AdViewController if the response string contains the word AdMob, and it will use the hard coded size 728x90 if the screen width is 728 pixels or greater.
In summary, the Unity plugin is looking in the wrong location for the size of the ad it's trying to display. Is there another class in MoPub that contains the real size of the ad that was just received, rather than the buffered size that AdMob reports at first connection?