{"action":"created","issue":{"url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/161","labels_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/161/comments","events_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/161/events","html_url":"https://github.com/floatinghotpot/cordova-admob-pro/issues/161","id":89059094,"number":161,"title":"ad banner overlay=false cause problems on onHardwareBack or ionicPlatform.registerBackButtonAction.","user":{"login":"kongmeng","id":10123668,"avatar_url":"https://avatars.githubusercontent.com/u/10123668?v=3","gravatar_id":"","url":"https://api.github.com/users/kongmeng","html_url":"https://github.com/kongmeng","followers_url":"https://api.github.com/users/kongmeng/followers","following_url":"https://api.github.com/users/kongmeng/following{/other_user}","gists_url":"https://api.github.com/users/kongmeng/gists{/gist_id}","starred_url":"https://api.github.com/users/kongmeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kongmeng/subscriptions","organizations_url":"https://api.github.com/users/kongmeng/orgs","repos_url":"https://api.github.com/users/kongmeng/repos","events_url":"https://api.github.com/users/kongmeng/events{/privacy}","received_events_url":"https://api.github.com/users/kongmeng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-17T16:07:30Z","updated_at":"2015-07-06T11:57:55Z","closed_at":null,"body":"Very strange that if my overlay=true for ad banner, my $ionicPlatform.registerBackButtonAction and onHardwareBack work perfectly, when user click on back button it will back to previous state or prompt toast message before user exit. But once I change the overlay=false (by default) for ad banner, it will cause problems. Whenever the app was at main page or other page, when i click onHardwareBack it will direct exit the apps without going back previous state or prompt toast message. And I found that if my overlay=false, before the ad banner was load, the onHardwareBack still able confirm to work correctly, after the ad banner was loaded and appear, whole screen like being refresh and onHardwareBack will become not working correct. But overlay=true don have this issue at all. \r\nRemark: I already try many difference method like deviceready, addeventlistener onAdload only call that function of ionicPlatform.registerBackButtonAction also not working. My platform is android, with newest cordova.js 4.0.2. Node v0.12.4 and cordova CLI also newest v5.1.1.\r\n\r\nBelow is my code.\r\n\r\nangular.module(XXXX)\r\n\r\n.config(XXX) {\r\n\r\n    $stateProvider.\r\n        state('menu', {\r\n           XXXX\r\n        }).\r\n        state('menu.about', {\r\n            XXX\r\n        }).\r\n        state('menu.setting', {\r\n           XXX\r\n        }).\r\n        state('menu.main', {\r\n            XXX\r\n        });\r\n \r\n    $urlRouterProvider.otherwise('XXXX');\r\n})\r\n\r\n.run(function($ionicPlatform, $localStorage, $rootScope, $location, $timeout, $ionicHistory, $cordovaToast, $state,) {\r\n\r\n    $ionicPlatform.ready(function () {\r\n\r\n        if(window.cordova && window.cordova.plugins.Keyboard) {\r\n          cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);\r\n        }\r\n        \r\n        if(window.StatusBar) {\r\n          StatusBar.styleDefault();\r\n        }\r\n        \r\n        //Admob\r\n        var admobid = {};\r\n        if( /(android)/i.test(navigator.userAgent) ) { \r\n            admobid = { // for Android\r\n                banner: 'XXXX',\r\n                interstitial: 'XXX'\r\n            };\r\n        } else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {\r\n            admobid = { // for iOS\r\n                 banner: 'XXXX',\r\n                 interstitial: 'XXX'\r\n            };\r\n        } else {\r\n            admobid = { // for Windows Phone\r\n                 banner: 'XXXX',\r\n                 interstitial: 'XXX'\r\n            };\r\n        }\r\n\r\n        AdMob.createBanner( {\r\n            adId:  admobid.banner, \r\n            isTesting: false,\r\n            overlap: true, \r\n            offsetTopBar: false, \r\n            position: AdMob.AD_POSITION.BOTTOM_CENTER,\r\n            autoShow: true\r\n        } );\r\n        \r\n        AdMob.prepareInterstitial({\r\n            adId:  admobid.interstitial,\r\n            autoShow: false\r\n        });\r\n    });\r\n    \r\n    $ionicPlatform.registerBackButtonAction(function (e) {\r\n\r\n        if ($location.path() == '/menu/main') {\r\n            if ($rootScope.backButtonPressedOnceToExit) {\r\n                if(AdMob) AdMob.showInterstitial();\r\n                ionic.Platform.exitApp();\r\n            } else {\r\n                $rootScope.backButtonPressedOnceToExit = true;\r\n                $cordovaToast.showShortTop('Press again to Exit :)');\r\n                setTimeout(function () {\r\n                    $rootScope.backButtonPressedOnceToExit = false;\r\n                }, 2000);\r\n            }\r\n        }else if ($ionicHistory.backView()) {\r\n            $ionicHistory.goBack();\r\n        } else {\r\n            $state.go($rootScope.previousState);\r\n        }\r\n        e.preventDefault();\r\n        return false;\r\n    }, 101);\r\n\r\n});\r\n"},"comment":{"url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/comments/118832748","html_url":"https://github.com/floatinghotpot/cordova-admob-pro/issues/161#issuecomment-118832748","issue_url":"https://api.github.com/repos/floatinghotpot/cordova-admob-pro/issues/161","id":118832748,"user":{"login":"sprsoft","id":120749,"avatar_url":"https://avatars.githubusercontent.com/u/120749?v=3","gravatar_id":"","url":"https://api.github.com/users/sprsoft","html_url":"https://github.com/sprsoft","followers_url":"https://api.github.com/users/sprsoft/followers","following_url":"https://api.github.com/users/sprsoft/following{/other_user}","gists_url":"https://api.github.com/users/sprsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/sprsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sprsoft/subscriptions","organizations_url":"https://api.github.com/users/sprsoft/orgs","repos_url":"https://api.github.com/users/sprsoft/repos","events_url":"https://api.github.com/users/sprsoft/events{/privacy}","received_events_url":"https://api.github.com/users/sprsoft/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T11:57:55Z","updated_at":"2015-07-06T11:57:55Z","body":"Yes. Using overlap:true works fine. I changed it on my project. Anyway it would be great not to loose the benefits of not overlapping the ads. "}}