tery.blargh February 2016

Cordova AdMobPro - Not working

I have installed all the necessary files on Android SDK. I'm using this code from tutorial:

var admobid = {};
    if( /(android)/i.test(navigator.userAgent) ) { // for android & amazon-fireos 
    admobid = {
        //banner: 'ca-app-pub-xxx/xxx', // or DFP format "/6253334/dfp_example_ad" 
        interstitial: 'ca-app-pub-9609087637503923/1710134090'
    };
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) { // for ios 
    admobid = {
        banner: 'ca-app-pub-xxx/zzz', // or DFP format "/6253334/dfp_example_ad" 
        interstitial: 'ca-app-pub-xxx/kkk'
    };
} else { // for windows phone 
    admobid = {
        banner: 'ca-app-pub-xxx/zzz', // or DFP format "/6253334/dfp_example_ad" 
        interstitial: 'ca-app-pub-xxx/kkk'
    };
}
if(AdMob)
{
    AdMob.prepareInterstitial( {adId:admobid.interstitial, autoShow:false} );
}

Program doesn't work. When tried using with Windows platform rather android it says AdMob not defined. Also program works when i add

 var admob;

(But of course admob doesn't work, only rest of program)

Cordova version 6.0.0

cordova-plugin-admobpro 2.11.1 "AdMob Plugin Pro"

UPDATE I finally got program to run on Android Studio and the program runs ok, but still no admob. The only "error" I was able to get out was this:

02-09 00:20:24.225 1193-1237/com.yourname.hello W/PluginManager: THREAD WARNING: exec() call to AdMob.prepareInterstitial blocked the main thread for 57ms. Plugin should use CordovaInterface.getThreadPool().

Along with this:

02-09 00:30:42.381 1193-1233/com.yourname.hello E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44

02-09 00:30:42.394 1193-1233/com.yourname.hello E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0

02-09 00:30:42.431 1193-1233/com.yourname.hello E/eglCodecCommon: **** ERROR unknown type 0x0 (glSizeof,72)

Please h

Answers


jaydroider February 2016

Try to add Cordova AdMobPro plugins js file.

Copy js file from plugin folder and put it into your js folder.

<script type="text/javascript" src="cordova.js"> </script>
<script type="text/javascript" src="js/index.js"> </script>
<script type="text/javascript" src="js/AdMob.js"> </script>

Hope this will help you !!

Post Status

Asked in February 2016
Viewed 3,224 times
Voted 8
Answered 1 times

Search




Leave an answer