Search code examples
cordovaadmobcordova-admob

Cordova and AdMob


I am using AdMob with cordova for displaying banners.

My Question is necessary to remove banner in pause ( when user left the app ) and in resume ( user oppen again the app ) display the banner again ?


Solution

  • If you're asking for a method that could hide the banner when in pause and show the banner when in resume (if I got the question), you can use the following Cordova functions:

    jQuery(document).ready(function($) {    
        $(document).on('deviceready', function() {
            /* Manage events */
            $(document).on('pause',                 function() {    /*Call function to hide banner*/                });
            $(document).on('resume',                function() {    /*Call function to show banner*/                });
        }
    }