Search code examples
iossdkcocos2d-iphoneadmob

AdMob with Cocos2d v3


I am trying to integrate AdMob banner with Cocos2d v3 project but no luck:(

All documentation samples and tutorials are for the old cocos version and do not compile.

Any samples or successful experience?


Solution

  • Here is my Cocos2d 3.0 Admob Baner Sample.

    In AppDelegate.h, define banner type on your need basis.

    typedef enum _bannerType
    {
        kBanner_Portrait_Top,
        kBanner_Portrait_Bottom,
        kBanner_Landscape_Top,
        kBanner_Landscape_Bottom,
    }CocosBannerType;
    
    #define BANNER_TYPE kBanner_Portrait_Top
    

    enter image description here enter image description here