user975767
user975767

Reputation: 51

Admob not working?

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

Answers (2)

RajPara
RajPara

Reputation: 2281

Are you sure that you've linked your project binary to the following libraries in your build settings:

  • AudioToolbox
  • MessageUI
  • SystemConfiguration
  • CoreGraphics

Upvotes: 19

Eric Leichtenschlag
Eric Leichtenschlag

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

Related Questions