예제 #1
0
        public override void Initialize(string zoneId, string adapterId, Dictionary<string, object> configuration)
        {
            string network = null;
              string platform = null;

              triggerEvent(EventType.initStart, EventArgs.Empty);

            if (configuration != null && configuration.ContainsKey(@"network"))
            network = (string)configuration[@"network"];

            platform = DeviceInfo.currentPlatform();
            if (network == null || network.Length == 0) {
                switch(platform) {
                    case @"ios":
                            network = @"picture_ios";
                        break;
                    case @"android":
                            network = @"picture_android";
                        break;
                    default:
                            network = @"picture_editor";
                        break;
                }
            }

            _manager = new PictureAdsManager(network);
            _manager.setPictureAdDidClosedDelegate(onPictureAdDidClosed);
            _manager.setPictureAdWillBeClosed(onPictureAdWillBeClosed);
            _manager.setPictureAdFailedDelegate(onPictureAdFailed);
            _manager.setPictureAdReadyDelegate(onPictureAdReady);
            _manager.setPictureAdWillBeShownDelegate(onPictureAdWillBeShown);
            _manager.setPictureAdDidOpenDelegate(onPictureAdDidOpen);
            _manager.setPictureAdClicked(onPictureAdClicked);
            _manager.init();
        }
예제 #2
0
        public override void Initialize(string zoneId, string adapterId, Dictionary <string, object> configuration)
        {
            string network  = null;
            string platform = null;

            triggerEvent(EventType.initStart, EventArgs.Empty);
            if (configuration != null && configuration.ContainsKey(@"network"))
            {
                network = (string)configuration[@"network"];
            }

            platform = DeviceInfo.currentPlatform();
            if (network == null || network.Length == 0)
            {
                switch (platform)
                {
                case @"ios":
                    network = @"picture_ios";
                    break;

                case @"android":
                    network = @"picture_android";
                    break;

                default:
                    network = @"picture_editor";
                    break;
                }
            }

            _manager = new PictureAdsManager(network);
            _manager.setPictureAdClosedDelegate(onPictureAdClosed);
            _manager.setPictureAdFailedDelegate(onPictureAdFailed);
            _manager.init();
        }
예제 #3
0
        public void downloadJson(string network, PictureAdsManager manager)
        {
            PictureAdsRequest request = new PictureAdsRequest(network);

            request.setJsonAvailableDelegate(manager.jsonAvailableDelegate);
            request.setOperationCompleteDelegate(jsonOperationComplete);
            _requestsForJSON.Push(request);
            if (_requestsForJSON.Count == 1)
            {
                RequestsForJSONLoop();
            }
        }
예제 #4
0
        public void downloadResourcesForAd(string network, PictureAdsManager manager, PictureAd ad)
        {
            PictureAdsRequest request = new PictureAdsRequest(network);

            request.setResourcesAvailableDelegate(manager.resourcesAvailableDelegate);
            request.setOperationCompleteDelegate(resourcesOperationComplete);
            request.ad = ad;
            _requestsForResources.Push(request);
            if (_requestsForResources.Count == 1)
            {
                RequestsForResourcesLoop();
            }
        }
 public void downloadResourcesForAd(string network, PictureAdsManager manager, PictureAd ad)
 {
     PictureAdsRequest request = new PictureAdsRequest(network);
     request.setResourcesAvailableDelegate(manager.resourcesAvailableDelegate);
     request.setOperationCompleteDelegate(resourcesOperationComplete);
     request.ad = ad;
     _requestsForResources.Push(request);
     if(_requestsForResources.Count == 1)
         RequestsForResourcesLoop();
 }
 public void downloadJson(string network, PictureAdsManager manager)
 {
     PictureAdsRequest request = new PictureAdsRequest(network);
     request.setJsonAvailableDelegate(manager.jsonAvailableDelegate);
     request.setOperationCompleteDelegate(jsonOperationComplete);
     _requestsForJSON.Push(request);
     if(_requestsForJSON.Count == 1)
         RequestsForJSONLoop();
 }