Exemple #1
0
    // Banner Ad

    public void OnToggleBannerAd()
    {
        // Hide a banner ad if it's already visible

        if (_isBannerAdShown)
        {
            _isBannerAdShown = false;
            Enhance.HideBannerAd();
            writeLog("Hiding banner ad");
            return;
        }

        // The ad isn't visible, check whether it's available

        if (!Enhance.IsBannerAdReady())
        {
            writeLog("Banner ad is not ready");
            return;
        }

        // The ad is available, display it

        Enhance.ShowBannerAdWithPosition(Enhance.Position.BOTTOM);
        _isBannerAdShown = true;
        writeLog("Showing banner ad");

        // This will show our ad at the bottom of the screen
        // You can also change the position to Enhance.Position.TOP
    }
Exemple #2
0
    /**
     * Show banner ad
     *
     * @param position position (top or bottom)
     */
    public static void ShowBannerAd(string placement, string position)
    {
        Enhance.Position ePos = Enhance.Position.BOTTOM;
        if (position.Equals("BOTTOM", StringComparison.OrdinalIgnoreCase))
        {
            ePos = Enhance.Position.TOP;
        }

        Enhance.ShowBannerAdWithPosition(placement, ePos);
    }