Hi Mani,By "blank banners", do you mean a empty banner without any content, or no banner at all? If this is a concern, you can definitely write up some logic, such as app events, to remove your GADBannerView and the allotted space from the viewcontroller. [Mani] Yes. Its empty banner(white) without any content. Right now, i am allotting space for banner only in adViewDidReceiveAd callback. But in this case, blank banner is shown since "adViewDidReceiveAd" is called. Can you pls help me understand, how to avoid it using app events till we resolve this issue?
I was testing with a few other ad unit IDs (incl. the sample one) and yours, and I was able to see banners returned for all scenarios. By now I'm starting to suspect that your ad might be trying to serve some other ads whose sizes might be greater than the rectangle you allocated for your creative (this I can't say for sure, since geo-restriction might apply for us, so I might be seeing more eligible ads than you are). And since the ad has already been fetched (adViewDidReceiveAd called), and the SDK can't render it on the screen, there is "nothing" visible.
However, that is only a theory. To validate this, I'd recommend using a tool such as Charles to proxy your network traffic. From there, you can check for each ad request if there is a legitimate ad response from the server. [Mani] I don't think its a size issue. In that case, you also shouldn't see the banner. I will validate the request/response using Charles Proxy and will let you know.As you said, it shouldn't be an implementation problem, since you were seeing the issue with our sample code. The root issue might be ad unit ID specific, but if adViewDidReceiveAd is called when absolutely nothing is returned from the server, then that might be a bug. Since I haven't been able to reproduce the original issue, I'd recommend not allocating a definitive area for your ad, plus removing custom targeting. This is to increase the rate at which we are confident there is always an ad returned for every request. With those changes in place, do a couple more testing and let me know if you continue seeing the issue. [Mani] You are saying you are not able to reproduce the issue. Can you pls let me know which device, OS version and which code base are you testing with?
<script>
// Send a color=green event when ad loads.
admob.events.dispatchAppEvent("color", "green");
handleClick = function() {
// Send a color=blue event when ad is clicked.
admob.events.dispatchAppEvent("color", "blue");
};
</script>
import com.google.android.gms.ads.doubleclick.*;
public class BannerExample extends Activity implements AppEventListener {
}
public interface AppEventListener {
void onAppEvent(String name, String info);
}
adView.setAppEventListener(this);
@Override
public void onAppEvent(String name, String info) {
if ("color".equals(name)) {
if ("green".equals(info)
// Set background color to green.
else if ("blue".equals(info)
// Set background color to blue.
}