button for admob interstitial_ad_unit_id

0

Personal I'm pretty laid back in the case, and I'd like to know how I can do when someone clicks on an initial menu button to pop up an interstitial_ad_unit_id announcement. I tried to use this form but it did not work.

     createInterstitial Ad

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">

    <title>Listas IPTV Online</title>

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Material Design Bootstrap -->
    <link href="css/mdb.min.css" rel="stylesheet">

    <!-- Template styles -->
    <style rel="stylesheet">
        /* TEMPLATE STYLES */

        main {
            margin-top: 3rem;
        }

        main .card {
            margin-bottom: 2rem;
        }

        @media only screen and (max-width: 768px) {
            .read-more {
                text-align: center;
            }
        }
    </style>

</head>

<body>

<main>
    <!--Main layout-->
    <div class="container">

        <!--First row-->
        <div class="row">
            <!--First column-->
            <div class="col-md-16">
                <!--Card-->
                <div class="card">

                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">Menu</h4>
                        <!--Text-->
                        <p class="card-text"> menu.</p>
                        <div class="read-more">
                            <a href="https://" class="btn btn-primary" onclick="window.plugins.AdMob.createBannerView();"><h4>Lista TV</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->
                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">menu 1</h4>
                        <!--Text-->
                        <p class="card-text">menu 1.</p>
                        <div class="read-more">
                            <a href="https://" class="btn btn-primary" onclick="window.plugins.AdMob.createBannerView();"><h4>Lista Filmes</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->
                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">menu 2</h4>
                        <!--Text-->
                        <p class="card-text"> menu 2.</p>
                        <div class="read-more">
                            <a href="https://" class="btn btn-primary" onclick="window.plugins.AdMob.createBannerView();"><h4>Lista Series</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->
                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">menu 3</h4>
                        <!--Text-->
                        <p class="card-text">menu 3.</p>
                        <div class="read-more">
                            <a href="https://" class="btn btn-primary" onclick="window.plugins.AdMob.createBannerView();"><h4>Lista Animes</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->
                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">menu 4</h4>
                        <!--Text-->
                        <p class="card-text">menu 4</p>
                        <div class="read-more">
                            <a href="https://" class="btn btn-primary" onclick="window.plugins.AdMob.createBannerView();"><h4>Notificações</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->
                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">Mural de Notificações</h4>
                        <!--Text-->
                        <p class="card-text">Mural de Notificações e etc.</p>
                        <div class="read-more">
                            <a href="https://" class="btn btn-primary" onclick="window.plugins.AdMob.createBannerView();"><h4>Notificações</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->

                </div>
                <!--/.Card-->
            </div>
            <!--/.First column-->

            <!--Second column-->
            <div class="col-md-16">
                <!--Card-->
                <div class="card">

                    <!--Card content-->
                    <div class="card-block">
                        <!--Title-->
                        <h4 class="card-title">menu 5</h4>
                        <!--Text-->
                        <p class="card-text">menu5.</p>
                        <div class="read-more">
                            <a href="https:" class="btn btn-primary" onclick="interstitial_ad_unit_id();"><h4>menu</h4></a>
                        </div>
                    </div>
                    <!--/.Card content-->

                </div>
                <!--/.Card-->
            </div>
            <!--/.Second column-->

            <!--Third column-->
            <div class="col-md-16">

                <!--Card-->
                <div class="card">


                </div>
                <!--/.Card-->
            </div>
            <!--/.Third column-->
        </div>
        <!--/.First row-->

        <!--Second row-->
        <div class="row">


        </div>
        <!--/.Card-->
    </div>
    <!--/.First column-->

    <!--Second column-->
    <div class="col-md-16">
        <!--Card-->
        <div class="card">



        </div>
        <!--/.Card-->
    </div>
    <!--Second column-->




    <div class="col-md-16">
        <div class="card">
            <div class="card-block">
                <h4 class="card-title">Suporte</h4>
                <div class="read-more">
                    <a href="https://" class="btn btn-primary"><h4>contato</h4></a>
                </div>
            </div>
        </div>
    </div>


    <div class="col-md-16">
        <div class="card">
            <div class="card-block">
                <h4 class="card-title">Avalie o app</h4>
                <div class="read-more">
                    <a id="rate-app" class="btn btn-primary" onClick="rateApp()"><h4>Avaliar App</h4></a>
                </div>
            </div>
        </div>
    </div>

 
    <!--/.Second row-->
    <hr>

    </div>
    <!--/.Main layout-->
</main>

<!-- SCRIPTS -->

<!-- JQuery -->
<script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>

<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/tether.min.js"></script>

<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.min.js"></script>

<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.min.js"></script>

<script type="text/javascript" src="js/script.js"></script>

<script type="text/javascript">
        function getFirebaseToken() {
             alert(android.getFirebaseToken());
        }

        function getOneSignalToken() {
             alert("RegisterId:" + android.getOneSignalRegisteredId() );
        }

        function isProductPurchased() {
            alert(android.isProductPurchased());
        }

        function createNotification(display, message) {
            android.createNotification(display, message);
        }

        function showLoader() {
            android.showLoader();
        }

        function hideLoader() {
            android.hideLoader();
        }

        function fontSizeNormal() {
            android.fontSizeNormal();
        }

        function fontSizeLarger() {
            android.fontSizeLarger();
        }


        function fontSizeLargest() {
            android.fontSizeLargest();
        }

        function fontSizeSmaller() {
            android.fontSizeSmaller();
        }

       function fontSizeSmallest() {
            android.fontSizeSmallest();
       }

       function rateApp() {
            android.rateApp();
       }

        function playSong() {
            android.playSound("beep");
       }

       function locationTracker(longitude, latitude) {
            var message = longitude + "," + latitude;
            console.log(message);
       }

        var currentFont = 2;
        var fontSizeFunc = [fontSizeSmallest, fontSizeSmaller, fontSizeNormal, fontSizeLarger, fontSizeLargest]

       function fontDec() {
            if (currentFont > 0) {
                currentFont--;
            }
            fontSizeFunc[currentFont]();
       }

       function fontInc() {
            if (currentFont < 4) {
                currentFont++;
            }
            fontSizeFunc[currentFont]();
       }

       function ajaxRequest(){
            var xhr = new XMLHttpRequest();
            xhr.open('GET', 'https://restcountries.eu/rest/v2/all');
            xhr.send(null);
            xhr.onreadystatechange = function () {
              var DONE = 4; // readyState 4 means the request is done.
              var OK = 200; // status 200 is a successful return.
              if (xhr.readyState === DONE) {
                if (xhr.status === OK)
                     alert(xhr.responseText);
                }
              }
        };
        //functions to allow you to know when ads are shown, etc.
function registerAdEvents() {
        document.addEventListener('onReceiveAd', function(){});
        document.addEventListener('onFailedToReceiveAd', function(data){});
        document.addEventListener('onPresentAd', function(){});
        document.addEventListener('onDismissAd', function(){ });
        document.addEventListener('onLeaveToAd', function(){ });
        document.addEventListener('onReceiveInterstitialAd', function(){ });
        document.addEventListener('onPresentInterstitialAd', function(){ });
        document.addEventListener('onDismissInterstitialAd', function(){
            window.plugins.AdMob.createInterstitialView();          //REMOVE THESE 2 LINES IF USING AUTOSHOW
            window.plugins.AdMob.requestInterstitialAd();           //get the next one ready only after the current one is closed
        });
    }

//display the banner
function showBannerFunc(){
    window.plugins.AdMob.createBannerView();
}
//display the interstitial
function showInterstitialFunc(){
    window.plugins.AdMob.showInterstitialAd();
}
    </script>
</body>
</html>
    
asked by anonymous 23.12.2018 / 16:23

0 answers