Admob not work in Intel XDK 3922

Report Construct 2 bugs here.

Post » Wed May 10, 2017 7:01 pm

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
B
5
S
1
Posts: 2
Reputation: 385

Post » Thu May 11, 2017 5:00 pm

@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 <

Code: Select all
<!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 http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag -->
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <style>
        /* following two viewport lines are equivalent to the meta viewport statement above, needed for Windows */
        /* see http://www.quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and http://dev.w3.org/csswg/css-device-adapt/ */
        @-ms-viewport { width: 100vw ; zoom: 100% ; }  @viewport { width: 100vw ; zoom: 100% ; }
        @-ms-viewport { user-zoom: fixed ; }           @viewport { user-zoom: fixed ; }
    </style>
</head>

<body>
    <div>
        <h1 style="font-size:2rem;">demo</h1>
       
        <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>
       
        <lu style="font-size:1.25rem;">
            <li><a href="javascript:admob.cacheInterstitial();">load Interstitial</a></li>
            <br/>
            <li><a href="javascript:showInterstitial();">show Interstitial</a></li>
            <br/>
            <li><a href="javascript:showTestBanner();">show test banner</a></li>
            <br/>
            <li><a href="javascript:admob.showBannerAbsolute(admob.BannerSize.BANNER,0,70);">banner 1</a></li>
            <br/>
            <li><a href="javascript:admob.showBannerAbsolute(admob.BannerSize.BANNER,30,70);">banner 2</a></li>
            <br/>
            <li><a href="javascript:admob.showBanner(admob.BannerSize.BANNER,admob.Position.BOTTOM_CENTER,null)">banner 3</a></li>
            <br/>
            <li><a href="javascript:admob.showBanner(admob.BannerSize.BANNER,admob.Position.BOTTOM_APP,null)">banner 4</a></li>
            <br/>
            <li><a href="javascript:admob.hideBanner()">hide banner</a></li>
        </lu>
    </div>
   
    <div id="alertdiv"/>
   
    <script src="cordova.js"></script>
   
    <script type="text/javascript">
        function showTestBanner(){
                var admobParam=new  admob.Params();
                //admobParam.extra={'keyword':"admob phonegame"};
                //admobParam.isForChild=true;
                admobParam.isTesting=true;
                admob.showBanner(admob.BannerSize.BANNER,admob.Position.TOP_CENTER,admobParam);
        }
        function showInterstitial(){
            admob.isInterstitialReady(function(isReady){
                if(isReady){
                    admob.showInterstitial();
                }
            });
        }
        function onInterstitialReceive (message) {
            alert(message.type + ', you now "show Interstitial" ad');
            //admob.showInterstitial();//show it when received
        }
        function onReceiveFail (message) {
            var msg=admob.Error[message.data];
            if(msg==undefined){
               msg=message.data;
            }
            document.getElementById("alertdiv").innerHTML="load fail: "+message.type+"  "+msg;
        }
        function onDeviceReady() {
            admob.initAdmob("ca-app-pub-3940256099942544/2934735716","ca-app-pub-3940256099942544/4411468910");
            document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);
            document.addEventListener(admob.Event.onInterstitialFailedReceive,onReceiveFail, false);
            document.addEventListener(admob.Event.onBannerFailedReceive,onReceiveFail, false);
        }
        document.addEventListener('deviceready',onDeviceReady, false);
    </script>
</body>

</html>
Intel Corporation
B
13
S
3
Posts: 79
Reputation: 925

Post » Sat May 13, 2017 11:03 am

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? :D
B
5
S
1
Posts: 2
Reputation: 385

Post » Tue May 16, 2017 10:58 pm

nyuszi008 wrote: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 <

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

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 <
Intel Corporation
B
13
S
3
Posts: 79
Reputation: 925


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests