0 Favourites

Admob not work in Intel XDK 3922

  • Problem Description

    Admob not work in intel XDK 3922

    .capx and intel XDK project source

    https://mega.nz/#F!dB8lWKBA!Zptig1MyLkLIGiQ-63vdbQ

    Steps to Reproduce Bug

    • Add Admob plugin and add your Admob code
    • Export to Cordova
    • Open the .xdk file with intel XDK
    • Add "Admob plugin"

    Observed Result

    Ads will not show

    Expected Result

    Ads have to show

    Affected Browsers

    • Mobile: (YES)

    Operating System and Service Pack

    Windows 10 1703

    Construct 2 Version ID

    244 64-bit

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • nyuszi008 -- try this experiment:

    • Create an XDK project using the "blank cordova template."
    • Add the "admob" plugin using the Plugin Manager on the Projects tab.
    • Replace the contents of the index.html file, in your new project, with the code below.
    • Build, install and run.

    I suspect the problem is in your code. The example code below comes directly from the sample code in the "admob" plugin repo (slight cleanup, modified font sizes, added instructional paragraph). See the original here > https://github.com/admob-google/admob-c ... index.html <

    <!DOCTYPE html>
    <html>
    
    <head>
        <title>AdMob banner demo</title>
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    
        <!-- see 

    webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag -->[/p] <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">[/p] <style>[/p] /* following two viewport lines are equivalent to the meta viewport statement above, needed for Windows */[/p] /* see quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and dev.w3.org/csswg/css-device-adapt */[/p] -ms-viewport { width: 100vw ; zoom: 100% ; } viewport { width: 100vw ; zoom: 100% ; }[/p] -ms-viewport { user-zoom: fixed ; } viewport { user-zoom: fixed ; }[/p] </style>[/p] </head>[/p] [/p] <body>[/p] <div>[/p] <h1 style="font-size:2rem;">demo</h1>[/p] [/p] <p>You must first touch the "load Intersitial" link and wait for an alert() message. After you get the alert() message, the "show Interstitial" link will work. Due to network and API delays, you may not always see an immediate response to clicking a link.</p>[/p] [/p] <lu style="font-size:1.25rem;">[/p] <li><a href="javascript:admob.cacheInterstitial();">load Interstitial</a></li>[/p] <br/>[/p] <li><a href="javascript:showInterstitial();">show Interstitial</a></li>[/p] <br/>[/p] <li><a href="javascript:showTestBanner();">show test banner</a></li>[/p] <br/>[/p] <li><a href="javascript:admob.showBannerAbsolute(admob.BannerSize.BANNER,0,70);">banner 1</a></li>[/p] <br/>[/p] <li><a href="javascript:admob.showBannerAbsolute(admob.BannerSize.BANNER,30,70);">banner 2</a></li>[/p] <br/>[/p] <li><a href="javascript:admob.showBanner(admob.BannerSize.BANNER,admob.Position.BOTTOM_CENTER,null)">banner 3</a></li>[/p] <br/>[/p] <li><a href="javascript:admob.showBanner(admob.BannerSize.BANNER,admob.Position.BOTTOM_APP,null)">banner 4</a></li>[/p] <br/>[/p] <li><a href="javascript:admob.hideBanner()">hide banner</a></li>[/p] </lu>[/p] </div>[/p] [/p] <div id="alertdiv"/>[/p] [/p] <script src="cordova.js"></script>[/p] [/p] <script type="text/javascript">[/p] function showTestBanner(){[/p] var admobParam=new admob.Params();[/p] //admobParam.extra={'keyword':"admob phonegame"};[/p] //admobParam.isForChild=true;[/p] admobParam.isTesting=true;[/p] admob.showBanner(admob.BannerSize.BANNER,admob.Position.TOP_CENTER,admobParam);[/p] }[/p] function showInterstitial(){[/p] admob.isInterstitialReady(function(isReady){[/p] if(isReady){[/p] admob.showInterstitial();[/p] }[/p] });[/p] }[/p] function onInterstitialReceive (message) {[/p] alert(message.type + ', you now "show Interstitial" ad');[/p] //admob.showInterstitial();//show it when received[/p] }[/p] function onReceiveFail (message) {[/p] var msg=admob.Error[message.data];[/p] if(msg==undefined){[/p] msg=message.data;[/p] }[/p] document.getElementById("alertdiv").innerHTML="load fail: "+message.type+" "+msg;[/p] }[/p] function onDeviceReady() {[/p] admob.initAdmob("ca-app-pub-3940256099942544/2934735716","ca-app-pub-3940256099942544/4411468910");[/p] document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);[/p] document.addEventListener(admob.Event.onInterstitialFailedReceive,onReceiveFail, false);[/p] document.addEventListener(admob.Event.onBannerFailedReceive,onReceiveFail, false);[/p] }[/p] document.addEventListener('deviceready',onDeviceReady, false);[/p] </script>[/p] </body>[/p] [/p] </html>[/p] [/code:1li6ggny]

  • Thanks for answer.

    I do everything and the program wrote that:

    load fail: onAdmobIntersitialFailedReceive ERROR_CODE_ERNAL_ERROR

    Can you send an APK file?

    And what do you think about the Intel XDK because so many function will be DEPRECATED how we build c2-apps?

  • Thanks for answer.

    I do everything and the program wrote that:

    load fail: onAdmobIntersitialFailedReceive ERROR_CODE_ERNAL_ERROR

    Can you send an APK file?

    Multiple builds of the AdMob test app I provided you can be found here > https://software.intel.com/en-us/node/734463 <

    And what do you think about the Intel XDK because so many function will be DEPRECATED how we build c2-apps? <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    You can build Construct2 Apps using PhoneGap Build or Cordova CLI, both will work. See this doc for some help > https://software.intel.com/en-us/xdk/do ... ordova-cli <

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