Reputation: 51
I made an app before and this code worked before the 5.0.1 update but it wont work on the new app. What could be the problem?
Here's the code:
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
// Do any additional setup after loading the view from its nib.
// 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 = MY_BANNER_UNIT_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_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];}
Upvotes: 1
Views: 4162
Reputation: 2281
Are you sure that you've linked your project binary to the following libraries in your build settings:
Upvotes: 19
Reputation: 8931
You'll have to replace MY_BANNER_UNIT_ID
with your actual publisher ID to get ads if you haven't done that already.
Also, any AdMob SDK 5.0.x release requires you to use XCode 4.2 or above. Try updating if you don't already have 4.2.
Upvotes: 0