示例#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
    }
示例#2
0
 /**
  * Check if a banner ad is ready
  *
  * @return true if an banner ad is ready, false if not
  */
 public static bool IsBannerAdReady(string placement)
 {
     return(Enhance.IsBannerAdReady(placement));
 }