ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
194 stars 178 forks source link

Conflict admob plugin #72

Open ocsi94 opened 5 years ago

ocsi94 commented 5 years ago

Conflicting admob plugin

Admob add a native view(google ad bar), the ad resize the webview to a like webViewHeight=deviceHeight-adHeight, when this plugin resize the webview just broke the admob plugin resize. Maybe a solution if store the webview height before open the keyboard. Qiuckfix: in bannerconfig set overlap: true, and add an element with 60px height

jcesarmobile commented 5 years ago

can you provide a sample app?

souly1 commented 3 years ago

Hey, So to repeat the symptom as i had it: When closing the keyboard when ad banner displayed at button the button bar would be hidden behind banner. looking at the banner's logic given what @ocsi94 said I saw that a resize happens on every ad show (even if ads already visible) So to provide a temporary fix, I have a boolean flag 'IsBannerShown' and I added a listener to keyboard hide and then call the ads.show() method:

 window.addEventListener('keyboardWillHide', () => {
            $timeout(function() {
                adsService.resizeBanner(); // this check is banner is currently shown and if so calls .show() method again
            }, 0);
        });