2011-05-11 19 views
8

Estoy tratando de utilizar AdMob en una aplicación (construido para iOS 4.0)AdMob no mostrar anuncios en el simulador de iOS

He añadido el código de ejemplo disponible en el tutorial http://code.google.com/mobile/ads/docs/ios/fundamentals.html que es el siguiente (he cambiado la adUnitId):

// Create a view of the standard size at the bottom of the 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 the ad's "unit identifier." This is your AdMob Publisher ID. 
bannerView_.adUnitID = @"XYZ"; 

// Let the runtime know which UIViewController to restore after taking 
// the user wherever the ad goes and add it to the view hierarchy. 
bannerView_.rootViewController = self; 
[self.view addSubview:bannerView_]; 
[self.view bringSubviewToFront:bannerView_]; 

GADRequest * request = [GADRequest request]; 

// Initiate a generic request to load it with an ad. 
[bannerView_ loadRequest:request]; 

Hacer esto no pasa nada, no se muestra ningún anuncio y el número de solicitudes en mi página de la aplicación de AdMob aumento de manera irregular (es decir: me parece que no puede notar un patrón), pero el más importante no se muestra el anuncio

Si añado el siguiente código:

GADRequest * request = [GADRequest request]; 

request.testDevices = [NSArray arrayWithObjects: 
         GAD_SIMULATOR_ID,        // Simulator 
         nil]; 

// Initiate a generic request to load it with an ad. 
[bannerView_ loadRequest:request]; 

recibo el "! Éxito Ahora está listo para viajar a través de la App Galaxy" bandera por defecto, pero sólo éste.

Así que mis preguntas son:

  • no son el código de muestra suficiente para mostrar anuncios? ¿Por qué nunca veo un anuncio con el código de muestra?
  • Por lo que yo entiendo, las solicitudes significan la cantidad de veces que mi aplicación solicitó la publicación de un anuncio. También entendí que no todas las solicitudes se responden con un anuncio (de lo contrario, la tasa de cumplimiento sería del 100%), pero aun así, NUNCA vi un anuncio, ¿qué estoy haciendo mal?

Gracias de antemano.

Respuesta

-4

Pruébalo en el dispositivo. Las aplicaciones en el simulador no muestran anuncios Admob.

+0

Estoy experimentando dificultades similares, y el dispositivo no es mejor. ¿Otra sugerencia? –

+1

Compruebe si ha registrado un adUnitID que es válido. Si lo ha colocado como: 'GADBannerView * bannerView = [[GADBannerView alloc] initWithFrame: CGRectMake (0.0, self.view.frame.size.height - GAD_SIZE_320x50.height - 42, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height) ]; bannerView.adUnitID = MY_BANNER_AD_ID; ' Si no ha registrado una. El punto de entrada es probablemente aquí: http://www.admob.com/register – rushafi

+1

Finalmente, fue el retraso que tiene cuando ejecuta una nueva ID de unidad. Lo tuve nuevamente unos días después, ya que nadie usó la aplicación, pero ahora que está activa, aparecen los anuncios. –

4
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 your id 

// Let the runtime know which UIViewController to restore after taking 
// the user wherever the ad goes and add it to the view hierarchy. 


bannerView.rootViewController = self; 

[self.view addSubview:bannerView];//Your attempt to add bannerview 


// Initiate a generic request to load it with an ad. 

[bannerView loadRequest:[GADRequest request]]; 
0

Establecí todos los métodos anteriores. El banner publicitario se ve correctamente en el dispositivo pero no muestra el anuncio en el simulador.

Establecí Id de dispositivo como GAD_SIMULATOR_ID.pero no funciona. Sus métodos delegados no están siendo llamados. !!

Cuestiones relacionadas