问题
I'm using ionic-framework
. I can create an admob
banner, 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