unity3d - admob ads not shown in android game made by unity -
anyone me in integrating admob ads android game ?
from unity editor console see ads created , requested , shown , works 100% not shown in android device .. why
using unityengine; using googlemobileads.api; public class ads : monobehaviour { bool called = false; void start() { if (application.loadedlevelname == "gameplay") { interesrequest(called); } if (application.loadedlevelname == "mainmenu") { bannerrequest(); } if (application.loadedlevelname == "levelscore") { } } void bannerrequest() { bannerview bannerview = new bannerview("ca-app-pub-5443208681329246/6087569010", adsize.banner, adposition.bottom); adrequest request = new adrequest.builder().build(); bannerview.loadad(request); bannerview.show(); } void interesrequest(bool call) { interstitialad inters = new interstitialad("ca-app-pub-5443208681329246/7564302219"); if (call) { if (inters.isloaded()) { inters.show(); called = false; } } else { adrequest request = new adrequest.builder().build(); inters.loadad(request); } } void update() { if (called) interesrequest(called); } public void onmousedown() { if (gameobject.name == "pause") { if (menu.bug) { called = true; } } }
}
you're calling request , show functions @ same time. impossible make request , show ads @ same time. make requests in onstart() function, , when level changed or whenever want show banner or interstatial ad. because need time download ads.
Comments
Post a Comment