如何在index.html之外显示phonegap admob

时间:2019-02-07 23:18:43

标签: admob phonegap-plugins phonegap

我在我的Web应用程序中使用phonegap adbmob插件,仅在index.html页面中工作良好,如何在其他页面中使用它? 这是我的index.html admob代码

script>
        function onLoad() {       
        document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
    }
     
    }
                admob.initAdmob("ca-app-pub-7193292113927984/6827828118","ca-app-pub-7193292113927984/3082780956");//admob id format ca-app-pub-xxxxxxxxxxxxxxxxxxx/xxxxxxxxxx

admob.showBanner(admob.BannerSize.SMART_BANNER,admob.Position.BOTTOM_APP);//show banner at the bottom of app 
//    admob.showBanner(admob.BannerSize.BANNER,admob.Position.TOP_APP);//show banner at the top of app 
        
         document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);//show in ad receive event fun need add receive listener
        setInterval(function(){admob.cacheInterstitial(); admob.showInterstitial();}, 30000);
 admob.cacheInterstitial();// load admob Interstitial
 function onInterstitialReceive(message) {//show in ad receive event fun
     admob.showInterstitial();
 }
 </script>

0 个答案:

没有答案