How to show AdMob banner in inappbrowser using Cordova/Ionic

一个人想着一个人 提交于 2019-12-12 12:06:00

问题


I'm using ionic-framework. I can create an admobbanner, but when I load inappbrowser the banner is not shown until I close the inappbroswer.

Is there a way to show the AdMob banner when inappbrowser is open?


回答1:


I reccomend you to use this plugin which I'm maintaining. You can see detailed examples on how to initiate admob when cordova is loaded: https://github.com/appfeel/admob-google-cordova/wiki/Angular.js,-Ionic-apps

var app = angular.module('myApp', ['admobModule']);

app.config(['admobSvcProvider', function (admobSvcProvider) {
  // Optionally you can configure the options here:
  admobSvcProvider.setOptions({
    publisherId:          "YOUR_PUBLISHER_ID",  // Required
    interstitialAdId:     "YOUR_PUBLISHER_ID"
  });
}]);


app.run(['admobSvc', function (admobSvc) {
  $rootScope.$on('admob:' + admobSvc.events.onAdOpened, function onAdOpened(evt, e) {
    console.log('adOpened: type of ad:' + e.adType);
  });
}]);


来源:https://stackoverflow.com/questions/28993016/how-to-show-admob-banner-in-inappbrowser-using-cordova-ionic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!