Custom Ads

Discussion in 'Technical Discussion' started by sysads, Feb 13, 2016.

  1. sysads

    sysads Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    885
    Likes Received:
    353
    Hi

    Anyone know how to use the custom ads option in scene? Can one integrate other ads easily with it?

    upload_2016-2-13_10-2-20.png
     
  2. sysads

    sysads Serious Boxer

    Joined:
    Oct 8, 2015
    Messages:
    885
    Likes Received:
    353
    So no one as ever tried using custom ads?
     
  3. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    i read it man, but i'm no hope... sorry
     
  4. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
  5. Aaron F

    Aaron F Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    146
    Likes Received:
    161
    You would most likely need a developer to integrate this for you. Basically, you setup the game to use custom ads then in Xcode you will integrate your custom code and it will show based on the settings in BB. (hope that makes sense)

    Look in the AppController.mm file and you will see a section called showCustomFullscreenAd (see image)

    I would only recommend this if you have a special need such as your publisher requiring a specific integration.
    [​IMG]
     
  6. energizerlithium

    energizerlithium Avid Boxer

    Joined:
    Oct 5, 2015
    Messages:
    110
    Likes Received:
    47
    Hey Thanks a lot that actually makes a lot of sense now:) Kind of hard to implement on our own but I'm glad the option is there:)
     
  7. wesam_badr

    wesam_badr Miniboss Boxer

    Joined:
    Oct 10, 2015
    Messages:
    1,065
    Likes Received:
    479
    if only there an actual tutorial and the codes needed to show how to implement this successfully. and that what ketchapp games do with buildbox games when you open a game like the pit a interstitial ad pop up with new ketchapp games and you can also remove the ad by pressing in the red button in the bottom left corner.
     
    Last edited: Feb 14, 2016
  8. wesam_badr

    wesam_badr Miniboss Boxer

    Joined:
    Oct 10, 2015
    Messages:
    1,065
    Likes Received:
    479
    --------- this what sean conner said https://www.buildbox.com/community/question/custom-ads

    1.3 introduced 2 new function in the AppController

    - (void)loadingDidComplete{}

    for custom code to execute after all loading is done, this is where we loaded ketchapp SDK in Line Zen for example.

    -(void)showCustomFullscreenAd{}

    for custom code to be executed when choosing "custom" from the ad network list for interstitials. This will allow you to implement you own ad network or (somewhat) complete ad manager if you like.

    This does require a programmer or programmer knowledge to pull off inputting a custom SDK though and while we offer it as a feature we do not support SDKs outside of the ones within Buildbox

    ----------- and this from BB manual

    Ad Interstitial: what ad network will show on this screen. Note: if you select an ad network
    that is not on the platform you are exporting, no ads will show on this screen (eg if you
    select Vungle and export to PC, there can be no ads shown as there is no such thing as
    Vungle on the PC at the time of writing).

    Custom is a special option that – for iOS and OSX only – allows you to call custom
    code for this screen. You could use this to implement your own ad lib, or for antyign
    you want to happen for a particular screen. You need to export the game, then edit
    the following:

    ▪ AppController.m file:
    -(void)showCustomFullscreenAd{}: This will get called when
    Buildbox needs to display an interstitial.

    - (void)loadingDidComplete{}:This is not strictly limited to custom
    ads, however it is called on game load, so you may wish to use it to
    initialise your code for use later (eg call startup ad caching for faster
    ad display).
     
    Last edited: Feb 14, 2016
  9. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Thanks @Aaron F! Could we also have some highlights what is the purpose for these functions? Is it only to do something what user clicks on banner ads or you can also create your own banner ads?

    Code:
    -(void)removeAd{
    //    [[Neocortex getInstance] removeBannerAd];
    }
    
    -(void)initAd{
    //    [[Neocortex getInstance] showBannerAd];
    }
    
    - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
        NSLog(@"iad banner load error: %@", [error description]);
    }
    
    - (void)bannerViewDidLoadAd:(ADBannerView *)banner{
        banner.hidden = NO;
    }
    
    - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave{
        cocos2d::CCDirector::sharedDirector()->pause();  
    //    CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
        returnYES;
    }
    
    - (void)bannerViewActionDidFinish:(ADBannerView *)banner{
        cocos2d::CCDirector::sharedDirector()->resume();
    //    CocosDenshion::SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
    }
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        PTModelGeneralSettings *generalSettings = PTModelGeneralSettings::shared();
        if(generalSettings->orientation() == PTPScreenOrientationLandscape){  
            return UIInterfaceOrientationIsLandscape( interfaceOrientation );
        }
        elseif(generalSettings->orientation() == PTPScreenOrientationPortrait){
            return UIInterfaceOrientationIsPortrait( interfaceOrientation );
        }
    
        returnNO;
    }
    PS: These are in RootViewController.mm
     
    Ishamahes likes this.
  10. Aaron F

    Aaron F Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    146
    Likes Received:
    161
    I can't really go into programming here because I'm not an expert and don't want to give you the wrong details. My honest opinion is to use Heyzap mediation for banners or just Admob since they are the best performing and have a very high fill rate.
     
    Ishamahes and Jamie like this.

Share This Page