Breaking News
Home / iOS / iOS Snippets / How to display an Admob add in iOS?

How to display an Admob add in iOS?

Answer

// The view that displays banner ads.  A minimum implementation to get an ad
// from within a UIViewController class is:

   // Place an ad at the top of the screen of an iPhone/iPod Touch.
   CGRect adFrame = CGRectZero;
   adFrame.size = GAD_SIZE_320x50;
<!>   // Create and setup the ad view.
  GADBannerView *adView = [[GADBannerView alloc] initWithFrame:adFrame];
  adView.rootViewController = self;
   adView.adUnitID = @”ID created when registering my app”;

   // Place the ad view onto the screen.
   [self.view addSubview:adView];
   [adView release];

   // Request an ad without any additional targeting information.
   [adView loadRequest:nil];

[pb_builder]

Check Also

EKCalendar – That account does not allow calendars to be added or removed

Usecase When I am trying to create a new Calendar programmatically using the EventKit API …

Leave a Reply