Esempio n. 1
0
        public void Init()
        {
            if (_inited)
            {
                return;
            }

                        #if ADCOLONY_ENABLED
            AdColony.Ads.OnConfigurationCompleted    += AdColony_Ads_OnConfigurationCompleted;
            AdColony.Ads.OnRequestInterstitial       += AdColony_Ads_OnRequestInterstitial;
            AdColony.Ads.OnRequestInterstitialFailed += AdColony_Ads_OnRequestInterstitialFailed;
            AdColony.Ads.OnOpened                += AdColony_Ads_OnOpened;
            AdColony.Ads.OnClosed                += AdColony_Ads_OnClosed;
            AdColony.Ads.OnExpiring              += AdColony_Ads_OnExpiring;
            AdColony.Ads.OnIAPOpportunity        += AdColony_Ads_OnIAPOpportunity;
            AdColony.Ads.OnRewardGranted         += AdColony_Ads_OnRewardGranted;
            AdColony.Ads.OnCustomMessageReceived += AdColony_Ads_OnCustomMessageReceived;

            // Set some test app options with metadata.
            AdColony.AppOptions appOptions = new AdColony.AppOptions();
            appOptions.AdOrientation = AdColony.AdOrientationType.AdColonyOrientationAll;
            AdColony.UserMetadata metadata = new AdColony.UserMetadata();
            appOptions.Metadata = metadata;

            List <string> _androidAdZones = new List <string>()
            {
                InterstitialZoneId, RewardedVideoZoneId
            };
            AdColony.Ads.Configure(AppId, appOptions, _androidAdZones.ToArray());

            _inited = true;
                        #endif
        }
        void ConfigureAds()
        {
            Debug.Log("**** Configure ADC SDK ****");

            AdColony.AppOptions appOptions = new AdColony.AppOptions();
//			appOptions.UserId = "foo";
            appOptions.AdOrientation = AdColony.AdOrientationType.AdColonyOrientationAll;

            string[] zoneIDs = new string[] { adIds.ADCOLONY_InterstitialVideoZoneID, adIds.ADCOLONY_RewardedVideoZoneID };

            AdColony.Ads.Configure(adIds.ADCOLONY_appId, appOptions, zoneIDs);
        }