1
3 번 클릭 할 때마다 삽입 광고를 호출하고 싶습니다. 유형에 대한 많은 질문을했지만 네이티브 Android에서만 나타났습니다. 관심을 가져 주셔서 감사합니다.ionicframework에서 3 클릭마다 admob interstitial을 호출하는 방법은 무엇입니까?
내 HTML 온 성
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ng-cordova.min.js"></script>
<script src="cordova.js"></script>
<link href="lib/ionic/css/ionic.css" type="text/css" rel="stylesheet">
<link href="css/animate.css" type="text/css" rel="stylesheet">
<link href="css/style.css" type="text/css" rel="stylesheet">
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/routes.js"></script>
<script src="js/directives.js"></script>
<script src="js/services.js"></script>
</head>
<body ng-app="passLite" animation="slide-left-right-ios7">
<div>
<div>
<ion-nav-bar class="bar-assertive">
<ion-nav-back-button class="button-clear"><i class="ion-android-arrow-back"></i> </ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
</div>
</div>
</body>
</html>
내 템플릿
<ion-view title="new" id="page2">
<ion-content padding="true" class="has-header">
<!--Config Button-->
<button class=" animated bounceIn" ng-click="btnClicked('click')">
<i class="icon ion-android-refresh"></i>
</button>
</ion-content>
</ion-view>
내 컨트롤러, 세웠 오류
angular.module('app.controllers', [])
.controller('new', ['$rootScope', '$scope', '$timeout', '$stateParams',
function ($rootScope, $scope, $timeout, $stateParams) {
$scope.counter = 1;
$scope.btnClicked = function(btn){
if (btn == 'click'){
//on every 3th clicks show the Interstitial ad one second after the result appears
if ($scope.counter++ == 3){
setTimeout(function(){
if (AdMob){
AdMob.showInterstitial();
}
$scope.counter = 1;
}, 1000);
}
}
};
}])