W
W
WizAlx2014-01-15 11:56:10
Objective-C
WizAlx, 2014-01-15 11:56:10

Why doesn't AdMob display a test banner (XCODE 5)?

I started to understand the monetization of iOS applications. I registered on AdMob, downloaded the SDK from the off site, fixed bugs, implemented it in a test project, wrote the code (according to off instructions), but the banner still wants to appear.

- (void)viewDidLoad
{
    [super viewDidLoad];
  
    GADRequest *request = [GADRequest request];
    
    request.testDevices = [NSArray arrayWithObjects:
                           GAD_SIMULATOR_ID,                                           // Симулятор
                           @"тут номер устройства",                // Тестовое устройство iOS
                           nil];
    // Создание представления стандартного размера внизу экрана.
    bannerView_ = [[GADBannerView alloc]
                   initWithFrame:CGRectMake(0.0,
                                            self.view.frame.size.height -
                                            GAD_SIZE_320x50.height,
                                            GAD_SIZE_320x50.width,
                                            GAD_SIZE_320x50.height)];
    
    // Назначение идентификатора объявлению. Указывается идентификатор издателя AdMob.
    bannerView_.adUnitID = @"366тут мой ID";
    
    // Укажите, какой UIViewController необходимо восстановить после перехода
    // пользователя по объявлению и добавить в иерархию представлений.
    bannerView_.rootViewController = self;
    [self.view addSubview:bannerView_];
    
    // Инициирование общего запроса на загрузку вместе с объявлением.
    [bannerView_ loadRequest:request];
    
}

So, CHADNT?
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
W
WizAlx, 2014-01-16
@WizAlx

Thanks everyone, problem solved. Due to the slight incorrectness of the Russian-language manual from Google, there was an inaccuracy.
Here it is:
bannerView_.adUnitID = @"366here is my ID";
You need to specify not your own ID "pub-012345...", but also the ID of the banner registered on AdMob in the format: "ca-app-pub-IDPublisher/IDBanner".
Good luck with monetization!

M
mozilla9, 2014-01-16
@mozilla9

Have you tried after
[self.view addSubview:bannerView_];
do something like
[self.view bringSubviewToFront:bannerView_];
maybe something is hiding it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question