iphone - AdMob not showing ads in iOS simulator -
i trying use admob on app (built ios 4.0)
i've added sample code available in tutorial http://code.google.com/mobile/ads/docs/ios/fundamentals.html following (i've changed adunitid):
// create view of standard size @ bottom of screen. bannerview_ = [[gadbannerview alloc] initwithframe:cgrectmake(0.0, self.view.frame.size.height - gad_size_320x50.height, gad_size_320x50.width, gad_size_320x50.height)]; // specify ad's "unit identifier." admob publisher id. bannerview_.adunitid = @"xyz"; // let runtime know uiviewcontroller restore after taking // user wherever ad goes , add view hierarchy. bannerview_.rootviewcontroller = self; [self.view addsubview:bannerview_]; [self.view bringsubviewtofront:bannerview_]; gadrequest * request = [gadrequest request]; // initiate generic request load ad. [bannerview_ loadrequest:request];
doing nothing happens, no ad shown , number of requests in admob app page increase erratically (i.e.: can't seem notice pattern), important no ad shown.
if add following code:
gadrequest * request = [gadrequest request]; request.testdevices = [nsarray arraywithobjects: gad_simulator_id, // simulator nil]; // initiate generic request load ad. [bannerview_ loadrequest:request];
i "success! ready travel through app galaxy" default banner, one.
so questions are:
- aren't sample code enough show ads? why never see ad sample code?
- as far understood, requests mean number of times app asked ad shown. understood not every request replied ad (otherwise fill rate 100%), still, never saw ad, doing wrong?
thanks in advance.
gadbannerview *bannerview = [[gadbannerview alloc] initwithframe:cgrectmake(0.0, self.view.frame.size.height - gad_size_320x50.height, gad_size_320x50.width, gad_size_320x50.height)];//set position bannerview.adunitid = @"12331255421245";//call id // let runtime know uiviewcontroller restore after taking // user wherever ad goes , add view hierarchy. bannerview.rootviewcontroller = self; [self.view addsubview:bannerview];//your attempt add bannerview // initiate generic request load ad. [bannerview loadrequest:[gadrequest request]];
Comments
Post a Comment