public AdMobBannerType admobGetBannerType(AdDisplayType bannerType) { if (bannerType == AdDisplayType.iPad_320x250) { return(AdMobBannerType.iPad_320x250); } else if (bannerType == AdDisplayType.iPad_468x60) { return(AdMobBannerType.iPad_468x60); } else if (bannerType == AdDisplayType.iPad_728x90) { return(AdMobBannerType.iPad_728x90); } else if (bannerType == AdDisplayType.iPhone_320x50) { return(AdMobBannerType.iPhone_320x50); } else if (bannerType == AdDisplayType.SmartBannerPortrait) { return(AdMobBannerType.SmartBannerPortrait); } else { return(AdMobBannerType.SmartBannerLandscape); } }
// HELPERS public bool iadShowBannerAd(AdDisplayType bannerType, AdPosition position) { // Try to get each typeof ad then show it bool hasAd = false; #if AD_USE_IAD if (bannerType == AdDisplayType.Banner) { bool showOnBottom = true; if (position == AdPosition.TopCenter || position == AdPosition.TopRight || position == AdPosition.TopLeft) { showOnBottom = false; } if (showOnBottom) { iadCreateAdBanner(iAdBannerPosition.Bottom, iAdBannerType.Banner); } else { iadCreateAdBanner(iAdBannerPosition.Top, iAdBannerType.Banner); } hasAd = true; } #endif return(hasAd); }
// ---------------------------------------------------------------------- // BANNERS //public static void ShowBannerAd() { // if (Instance != null) { // Instance.showBannerAd(); // } //} public static void ShowBannerAd( AdDisplayType bannerType = AdDisplayType.Banner, AdPosition position = AdPosition.BottomCenter) { if (Instance != null) { Instance.showBannerAd(bannerType, position); } }
public void showAd( AdDisplayType bannerType = AdDisplayType.Banner, AdPosition position = AdPosition.BottomCenter) { if (bannerType == AdDisplayType.Banner) { showBannerAd(bannerType, position); } else if (bannerType == AdDisplayType.Interstitial) { } }
public void showBannerAd( AdDisplayType bannerType = AdDisplayType.Banner, AdPosition position = AdPosition.BottomCenter) { bool hasAd = false; #if AD_USE_IAD if (!hasAd) { hasAd = iadShowBannerAd(bannerType, position); } #endif if (!hasAd) { } }