2013-05-03 11 views
5

Sto implementando Admob su app iOS.Dispositivi di prova Admob che non mostrano il simulatore udid

Ho appena scaricato Admob codice di esempio e quando ho provato a farlo funzionare sul simulatore, mia console sta dicendo "To get test ads on this device, call: request.testDevices = NSArray arrayWithObjects:@"GAD_SIMULATOR_ID", nil];".

Così, ho aggiunto il mio mac UDID e di un dispositivo di prova UDID di un array e impostare che a richiesta, ma l'app sta mostrando il banner predefinito invece degli annunci dal mio account AdM Anche console sta dicendo lo stesso messaggio precedente.Qualcuno ha avuto idea di cosa mi manca qui? Ecco il codice.

self.adBanner = [[[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner 
               origin:origin]; 
self.adBanner.adUnitID = kSampleAdUnitID; 
self.adBanner.delegate = self; 
[self.adBanner setRootViewController:self]; 
[self.view addSubview:self.adBanner]; 
self.adBanner.center = CGPointMake(self.view.center.x, self.adBanner.center.y); 
GADRequest *request = [GADRequest request]; 
request.testing = YES; 
request.testDevices = [NSArray arrayWithObjects: @"XXXX-XXXX-XXXX-XXXX-XXXXXXXX", 
              @"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
              nil]; 
[self.adBanner loadRequest:request]; 

BTW, ho sostituito il precedente kSampleAdUnitID con il mio ID editore Admob e XXX con m y id mac e id dispositivo.

+0

https://developers.google.com/mobile-ads-sdk/docs/admob/intermediate –

risposta

0

In realtà, non è necessario aggiungere testDevices per poter ricevuto annuncio
Anche io non ricevuto annuncio, ma quando rimuovo la mia deviceId in testDevices, funziona
Btw, se si desidera aggiungere simulatore ID usa solo @"GAD_SIMULATOR_ID", questo è l'ID predefinito per il simulatore, hai solo bisogno di un vero ID per il dispositivo reale.

8

Abilita annunci di prova

sul vostro iDevice, vai a Impostazioni> Privacy> Pubblicità e disattivare l'opzione 'limite Ad Tracking'. Quindi quando esegui la tua app su hardware, controlla la console di Xcode: lì vedrai l'ID, che puoi aggiungere all'array testDevices.

0

L'Id Devce di cui hai bisogno è l'hash MD5 dell'identificatore di pubblicità per il tuo telefono. Ho scaricato un'app chiamata "The Identifiers" link here che ti offre tutte le informazioni di cui hai bisogno.

Aggiungi l'hash MD5 dell'identificatore di pubblicità all'array testDevices nel metodo createView e vedrai quindi i dettagli nella tua app.

var ad1 = Admob.createView({ 
      height: 50, 
      top: 0, 
      debugEnabled: true, // If enabled, a dummy value for `adUnitId` will be used to test 
      adType: Admob.AD_TYPE_BANNER, 
      adUnitId: 'ca-app-pub-000000xxxxxxxxxx/8204200000', // You can get your own at http: //www.admob.com/ 
      adBackgroundColor: 'black', 
      testDevices: [Admob.SIMULATOR_ID,'xxxc8xx0xxxccxxb4a12cxxxxxxxxxxx'], // You can get your device's id by looking in the console log 
       dateOfBirth: new Date(1985, 10, 1, 12, 1, 1), 
       gender: Admob.GENDER_MALE, // GENDER_MALE or GENDER_FEMALE default: undefined 
      contentURL: 'https://admob.com', // URL string for a webpage whose content matches the app content. 
      requestAgent: 'Titanium Mobile App', // String that identifies the ad request's origin. 
    extras: { 
     'version': 1.0, 
     'name': 'Eyespy' 
    }, // Object of additional infos 
    tagForChildDirectedTreatment: false, // http:///business.ftc.gov/privacy-and-security/childrens-privacy for more infos 
    keywords: ['keyword1', 'keyword2'] 
    }); 

    $.adview.add(ad1); 
Problemi correlati