Ejemplo n.º 1
0
    public void CacheAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        #if ADFREE
        // Don't cache if Ad-free
        return;

        #endif

        if (Debug.isDebugBuild)
        {
            Debug.Log("Caching ad");
        }

        switch (displayType)
        {
            case DisplayedAdType.FullScreen:

        #if !MOREAPPSONLY

                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.cacheInterstitial(location);
                        break;
                }

        #endif

                break;

            case DisplayedAdType.MoreGames:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.cacheMoreApps(location);
                        break;
                }
                break;

            case DisplayedAdType.Video:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.cacheRewardedVideo(location);
                        break;
                }
                break;
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the data privacy consent status for the specified ad network.
 /// </summary>
 /// <returns>The data privacy consent.</returns>
 /// <param name="adNetwork">Ad network.</param>
 public static ConsentStatus GetDataPrivacyConsent(AdNetwork adNetwork)
 {
     return(GetAdClient(adNetwork).DataPrivacyConsent);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Revokes the provider-level data privacy consent of the specified ad network.
 /// </summary>
 /// <param name="adNetwork">Ad network.</param>
 public static void RevokeDataPrivacyConsent(AdNetwork adNetwork)
 {
     GetAdClient(adNetwork).RevokeDataPrivacyConsent();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Grants the provider-level data privacy consent for the specified ad network.
 /// </summary>
 /// <param name="adNetwork">Ad network.</param>
 public static void GrantDataPrivacyConsent(AdNetwork adNetwork)
 {
     // Use GetAdClient so the client won't be initialized (until it's actually used).
     // This is necessary as the consent should be set prior initialization for most networks.
     GetAdClient(adNetwork).GrantDataPrivacyConsent();
 }
Ejemplo n.º 5
0
 public bool IsActiveMediationNetwork(AdNetwork net)
 {
     return(settingsBridge.CallStatic <bool>("isActiveMediationNetwork", (int)net));
 }
Ejemplo n.º 6
0
    public void ShowAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        #if ADFREE

        // Don't show Ad if Ad-free
        return;

        #endif

        CurrentInterval++;

        if (CurrentInterval % this.AdDisplayInterval != 0 && displayType == DisplayedAdType.FullScreen)
        {
            if (Debug.isDebugBuild)
            {
                Debug.Log("Can't display Ad yet: " + CurrentInterval.ToString());
            }

            // Don't display until every interval
            return;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Showing Ad");
        }

        switch (displayType)
        {
            case DisplayedAdType.FullScreen:

        #if !MOREAPPSONLY

                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.showInterstitial(location);
                        break;
                }

        #endif

                break;

            case DisplayedAdType.MoreGames:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.showMoreApps(location);
                        break;
                }
                break;

            case DisplayedAdType.Video:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        Chartboost.showRewardedVideo(location);
                        break;
                }
                break;
        }
    }
Ejemplo n.º 7
0
 public static bool IsActiveNetwork(AdNetwork network)
 {
     return(CASFactory.IsActiveNetwork(network));
 }
Ejemplo n.º 8
0
 public string GetApiKey(AdNetwork adNetwork)
 {
     return((string)apiKeys[adNetwork]);
 }
Ejemplo n.º 9
0
 public static string GetExtraKeyGDPR(this AdNetwork network)
 {
     return(network.GetTag() + "_gdpr");
 }
Ejemplo n.º 10
0
 public static string GetExtraKeyCCPA(this AdNetwork network)
 {
     return(network.GetTag() + "_ccpa");
 }
Ejemplo n.º 11
0
    public void ShowAd(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
#if ADFREE
        // Don't show Ad if Ad-free
        return;
#endif

        CurrentInterval++;

        if (CurrentInterval % this.AdDisplayInterval != 0 && displayType == DisplayedAdType.FullScreen)
        {
            if (Debug.isDebugBuild)
            {
                Debug.Log("Can't display Ad yet: " + CurrentInterval.ToString());
            }

            // Don't display until every interval
            return;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Showing Ad");
        }

        switch (displayType)
        {
        case DisplayedAdType.FullScreen:

#if !MOREAPPSONLY
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.showInterstitial(location);
                break;
            }
#endif

            break;

        case DisplayedAdType.MoreGames:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.showMoreApps(location);
                break;
            }
            break;

        case DisplayedAdType.Video:
            switch (network)
            {
            case AdNetwork.ChartBoost:
            default:
                Chartboost.showRewardedVideo(location);
                break;
            }
            break;
        }
    }
 public Dependency(AdNetwork network)
 {
     this.name = network.GetName();
 }
        bool IsPluginAvail(AdNetwork adNetwork)
        {
            switch (adNetwork)
            {
            case AdNetwork.AdColony:
                    #if EM_ADCOLONY
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.AdMob:
                    #if EM_ADMOB
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.Chartboost:
                    #if EM_CHARTBOOST
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.AudienceNetwork:
                    #if EM_FBAN
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.Heyzap:
                    #if EM_HEYZAP
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.MoPub:
                    #if EM_MOPUB
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.IronSource:
                    #if EM_IRONSOURCE
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.TapJoy:
                    #if EM_TAPJOY
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.UnityAds:
                    #if UNITY_ADS
                return(true);
                    #else
                return(false);
                    #endif
            case AdNetwork.None:
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 14
0
 private float GetPopupDelayTime(AdNetwork network)
 {
     return(0f);
 }
Ejemplo n.º 15
0
 void ShowAds(AdNetwork network)
 {
     StartCoroutine(ShowingAds(network));
 }
Ejemplo n.º 16
0
 public void SetApiKey(AdNetwork adNetwork, string apiKey)
 {
     apiKeys[adNetwork] = apiKey;
 }
Ejemplo n.º 17
0
    public bool IsCached(AdNetwork network, DisplayedAdType displayType, CBLocation location)
    {
        bool isCached = false;

        #if ADFREE

        // Just return false if Ad-free
        return false;

        #endif

        switch (displayType)
        {
            case DisplayedAdType.FullScreen:

        #if !MOREAPPSONLY

                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        isCached = Chartboost.hasInterstitial(location);
                        break;
                }

        #endif

                break;

            case DisplayedAdType.MoreGames:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        isCached = Chartboost.hasMoreApps(location);
                        break;
                }
                break;

            case DisplayedAdType.Video:
                switch (network)
                {
                    case AdNetwork.ChartBoost:
                    default:
                        isCached = Chartboost.hasRewardedVideo(location);
                        break;
                }
                break;
        }

        if (Debug.isDebugBuild)
        {
            Debug.Log("Ad is cached: " + isCached.ToString());
        }

        return isCached;
    }
Ejemplo n.º 18
0
        public string GetUnitId(AdNetwork adNetwork, AdType adType)
        {
            Hashtable network = (Hashtable)unitIds[adNetwork];

            return((string)network[adType]);
        }
        private static string GetNetworkTag(AdNetwork network)
        {
            switch (network)
            {
            case AdNetwork.GoogleAds:
                return("AM");

            case AdNetwork.Vungle:
                return("V");

            case AdNetwork.Kidoz:
                return("K");

            case AdNetwork.Chartboost:
                return("CB");

            case AdNetwork.UnityAds:
                return("U");

            case AdNetwork.AppLovin:
                return("AL");

            case AdNetwork.SuperAwesome:
                return("SuA");

            case AdNetwork.StartApp:
                return("StA");

            case AdNetwork.AdColony:
                return("AC");

            case AdNetwork.FacebookAN:
                return("FB");

            case AdNetwork.InMobi:
                return("IM");

            case AdNetwork.MobFox:
                return("MF");

            case AdNetwork.MyTarget:
                return("MT");

            case AdNetwork.CrossPromotion:
                return("P");

            case AdNetwork.IronSource:
                return("IS");

            case AdNetwork.YandexAds:
                return("Ya");

            case AdNetwork.OwnVAST:
                return("Own");

            case AdNetwork.AmazonAds:
                return("AZ");

            case AdNetwork.Verizon:
                return("VZ");

            case AdNetwork.MoPub:
                return("MP");

            case AdNetwork.Tapjoy:
                return("TJ");

            case AdNetwork.Fyber:
            case AdNetwork.FairBid:
                return("Fy");

            case AdNetwork.Mintegral:
                return("MB");

            default:
                return(string.Empty);
            }
        }