Answer the question
In order to leave comments, you need to log in
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];
}
Answer the question
In order to leave comments, you need to log in
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!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question