Add Admob to Ejecta the easy way ?

0 favourites
  • 8 posts
From the Asset Store
Customize the animation of character when item changed
  • hi

    sorry for my bad english <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    so i found some one that make admob extension for Ejecta

    https://github.com/finscn/Ejecta

    and it is work !

    and you just need to add this code to index.js

    Banner code

    initAdMob= function() {
        
        var ad = new Ejecta.AdMobBanner("your admob app id ");
        
        /* Type:
         banner,
         mediumrectangle,
         fullbanner,
         leaderboard,
         skyscraper,
         portrait,
         landscape,
         invalid
         */
        ad.type = "banner";
        ad.x = 100;
        ad.y = 0;
        
        ad.onload = function() {
         console.log("load")
      
            
            ad.show(); // display ad
            // ad.hide()
            
        }
        ad.onclose = function() {
            console.log("closed")
        }
        ad.onclick = function() {
            console.log("clicked")
        }
        
        ad.load();
    }
    // call the ad after 1 sec of the game finish loading ,
    // it will not work if you not wait 1 sec i do not know why 
    setTimeout(function(){initAdMob()},1000);
    [/code:pgdkwq0z]
    
    Fullscreen Code
    
    [code:pgdkwq0z]
    // fullscreen ad
    var adPage = new Ejecta.AdMobPage("Your AppId of AdMob");
    adPage.onload = function() {
        console.log("loaded")
        adPage.show(); // can't hide it via code
    }
    adPage.onclose = function() {
        console.log("closed")
    }
    adPage.onclick = function() {
        console.log("clicked")
    }
    adPage.load();
    [/code:pgdkwq0z]
    
    if i add this code in the start of the index.js the ad will appear right at the beginning of the game  
    but i need to control when to show it or hide 
    so can any one    add this to  the ejecta plugin  like iAd or make plugin for this code  
    
    I think that many here will love to use  admob with admob 100 %  fill rate
  • How to do this to Crosswalk?

  • How to do this to Crosswalk?

    try this

    https://github.com/crosswalk-project/cr ... -Crosswalk

  • TO do this i need to build it outside intel XDK (that is my main build tool now), so i need to do all over crosswalk native right?

  • any one

  • Oh man, this is exactly what I need at this moment. I wish I knew how to implement it.

  • Sorry to necromance this topic, but mkhater have you found a way to call the fullscreen ads at any time in the game? I'd really like to implement this into my games

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • sorry, when i add this code, although i include my appid from admob another error appears saying ¨TypeError: undefined is not a constructor (evaluating 'new Ejecta.AdMobPage("Your AppId of AdMob")') at line 22203 in index.js¨can someone help me please!!!???

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)