Created
May 25, 2012 13:40
-
-
Save Rockncoder/2788231 to your computer and use it in GitHub Desktop.
AdMobCalculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a view of the standard size at the bottom of the screen. | |
| // Available AdSize constants are explained in GADAdSize.h. | |
| bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner]; | |
| // Must be a better way to position at bottom of page | |
| [bannerView_ setCenter:CGPointMake(kGADAdSizeBanner.size.width/2, 435)]; | |
| // 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. | |
| GADRequest *request = [GADRequest request]; | |
| // remove this line when you are ready to deploy for real | |
| request.testing = YES; | |
| [bannerView_ loadRequest:request]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment