(void)viewDidLoad {
[super viewDidLoad];
// Create a view of the standard size at the top of the screen.
// Available AdSize constants are explained in GADAdSize.h.
// Create a view of the standard size.
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(0,366,320,50)];
// Specify the ad unit ID.
bannerView_.adUnitID = @"ca-app-pub-4106+hidemyid+sorry";
// 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_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];
}
when I run my project, I didn’t see the banner appear.
my project is a cocos2d-x javascript project.
do I have to call the API in my scene javascript files? if so, how to call it?