Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
RootViewController replacement for Cocos2d that supports iAds and AdMob.
Objective-C C
branch: master
Failed to load latest commit information.
Classes Added color to layer
GoogleAdMobAdsSDK Updated cocos2d to 1.0.1 and Google AdMob SDK Version to 4.1.1
Resources
iAdsTest.xcodeproj Changed compiler and Updated readme
libs Ignored files
.gitattributes Added gitignore and gitattributes
.gitignore Ignored files
LICENSE.cocos2d first commit
LICENSE.cocosdenshion first commit
README.markdown Changed compiler and Updated readme
iAdsTest_Prefix.pch first commit
main.m Fixed iAd not showing when loaded in portrait mode in 4.3

README.markdown

AdRootViewController

RootViewController replacement for Cocos2d that supports iAds and AdMob.

Features

  • Two Positions to set the Ads (Top, or Bottom)
  • Autorotation support, using CCDirector or UIViewController
  • Universal support (iPhone + iPad)
  • Interstitial ads (AdMob Only)
  • Easy to use

Usage

Replace the RootViewController in the Cocos2d project with the AdRootViewController.

Define your AdMob publisher Id

#define ADMOB_PUBLISHER_ID @"your_publisher_id"

To add the ad to the controller's view call:

[viewController addBannerAd];

To remove the ad call:

[viewController removeBannerAd];

Interstitial Ads are shown calling:

[viewController addInterstitialAd];

You can set the position of the ad at the Top or Bottom of the Screen, just call:

[viewController setAdBannerPosition:kAdBannerPositionBottom] 

or

[viewController setAdBannerPosition:kAdBannerPositionTop]

Hope it helps, suggestions and corrections are always welcome.

Something went wrong with that request. Please try again.