コード例 #1
0
        private void InitSDK_Click(Object sender, RoutedEventArgs e)
        {
            // SDK Config: additional options
            VungleSDKConfig sdkConfig = new VungleSDKConfig();

            // Set minimum disk space required to initialize or load ads (in bytes)
            //sdkConfig.MinimumDiskSpaceForAd = 50 * 1024;
            //sdkConfig.MinimumDiskSpaceForInit = 50 * 1024;

            //Disable tracking of Hardare ID
            //sdkConfig.DisableAshwidTracking = true;

            sdkConfig.DisableBannerRefresh = false;

            // Obtain Vungle SDK instance
            sdkInstance = AdFactory.GetInstance(appID, sdkConfig);

            this.vungleBannerControl.AppID = appID;

            sdkInstance.UpdateConsentStatus(VungleConsentStatus.VungleConsentAccepted, "1.0");

            //Register event handlers
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
            sdkInstance.OnAdStart           += SdkInstance_OnAdStart;
            sdkInstance.OnAdEnd             += SdkInstance_OnAdEnd;
            sdkInstance.Diagnostic          += SdkInstance_Diagnostic;
            sdkInstance.OnInitCompleted     += SdkInstance_OnInitCompleted;

            InitSDK.IsEnabled = false;
        }
コード例 #2
0
        private void InitSDK_Click(Object sender, RoutedEventArgs e)
        {
            // Obtain Vungle SDK instance
            // As of v6 including placements in initialization call is no longer required
            sdkInstance = AdFactory.GetInstance(appID);

            // SDK Config: additional options
            // Set minimum disk space required to initialize or load ads (in bytes)
            //VungleSDKConfig sdkConfig = new VungleSDKConfig();
            //sdkConfig.MinimumDiskSpaceForAd = 50 * 1024 * 1024;
            //sdkConfig.MinimumDiskSpaceForInit = 50 * 1024 * 1024;
            //sdkInstance = AdFactory.GetInstance(appID, sdkConfig)

            //Disable tracking of Hardare ID
            //sdkConfig.DisableAshwidTracking = true;

            //Register event handlers
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
            sdkInstance.OnAdStart           += SdkInstance_OnAdStart;
            sdkInstance.OnAdEnd             += SdkInstance_OnAdEnd;
            sdkInstance.Diagnostic          += SdkInstance_Diagnostic;
            sdkInstance.OnInitCompleted     += SdkInstance_OnInitCompleted;

            InitSDK.IsEnabled = false;
        }
コード例 #3
0
        public void InitializeVungle(string appID)
        {
            m_vungle = AdFactory.GetInstance(appID);

            m_vungle.OnInitCompleted     += M_vungle_OnInitCompleted;
            m_vungle.OnAdPlayableChanged += M_vungle_OnAdPlayableChanged;
            m_vungle.Diagnostic          += M_vungle_Diagnostic;
        }
コード例 #4
0
    // Starts up the SDK with the given appId
    public static void init(string appId, string version)
    {
        VungleSDKConfig config = new VungleSDKConfig();

        config.SetPluginName("unity");
        config.SetPluginVersion(version);
        sdk = AdFactory.GetInstance(appId, config);
        sdk.addOnEvent(VungleManager.onEvent);
    }
コード例 #5
0
	// Starts up the SDK with the given appId
	public static void init( string appId, string version, params string[] placements )
	{
        VungleSDKConfig config = new VungleSDKConfig ();
        config.SetPluginName ("unity");
        config.SetPluginVersion (version);
        config.SetApiEndpoint(new Uri("http://ads.api.vungle.com"));
        sdk = AdFactory.GetInstance(appId, config, placements);
        sdk.addOnEvent(VungleManager.onEvent);
	}
コード例 #6
0
        public MainPage()
        {
            this.InitializeComponent();

            //Obtain Vungle SDK instance
            sdkInstance = AdFactory.GetInstance("vungleTest");

            //Register OnAdPlayableChanged event handler
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
        }
コード例 #7
0
        public MainPage()
        {
            InitializeComponent();

            // Obtain Vungle SDK instance
            sdkInstance = AdFactory.GetInstance("Test_Windows");

            // Register event handlers
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
            sdkInstance.OnAdStart           += SdkInstance_OnAdStart;
            sdkInstance.OnVideoView         += SdkInstance_OnVideoView;
            sdkInstance.OnAdEnd             += SdkInstance_OnAdEnd;
            sdkInstance.Diagnostic          += SdkInstance_Diagnostic;
        }
コード例 #8
0
        public MainPage()
        {
            InitializeComponent();

            // Obtain Vungle SDK instance
            sdkInstance = AdFactory.GetInstance("591236625b2480ac40000028", new string[] { "DEFAULT18080" });

            // Register event handlers
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
            sdkInstance.OnAdStart           += SdkInstance_OnAdStart;
            sdkInstance.OnVideoView         += SdkInstance_OnVideoView;
            sdkInstance.OnAdEnd             += SdkInstance_OnAdEnd;
            sdkInstance.Diagnostic          += SdkInstance_Diagnostic;
        }
コード例 #9
0
ファイル: MainPage.xaml.cs プロジェクト: smurz/Windows-SDK
        private void InitSDK_Click(Object sender, RoutedEventArgs e)
        {
            //Obtain Vungle SDK instance
            sdkInstance = AdFactory.GetInstance(appID, new string[] { placement1, placement2, placement3 });

            //Register event handlers
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
            sdkInstance.OnAdStart           += SdkInstance_OnAdStart;
            sdkInstance.OnAdEnd             += SdkInstance_OnAdEnd;
            sdkInstance.Diagnostic          += SdkInstance_Diagnostic;
            sdkInstance.OnInitCompleted     += SdkInstance_OnInitCompleted;

            InitSDK.IsEnabled = false;
        }
コード例 #10
0
ファイル: ADPage.xaml.cs プロジェクト: DooneZhang/GetVIP
        public ADPage()
        {
            this.InitializeComponent();

            sdkInstance = AdFactory.GetInstance(appID, interst);
            //为广告位置加载广告
            //    sdkInstance.LoadAd(interst);

            //广告状态改变后事件
            sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;

            sdkInstance.OnAdEnd += SdkInstance_OnAdEnd;

            sdkInstance.OnInitCompleted += SdkInstance_OnInitCompleted;
        }
コード例 #11
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            ViewModel.AdLoadingSpinnerVisibility = Visibility.Visible;
            _adRequested = true;
            if (VungleAdInstance == null)
            {
                VungleAdInstance = AdFactory.GetInstance("5735f9ae0b3973633c00004b");

                VungleAdInstance.OnAdPlayableChanged += VungleAdInstanceOnOnAdPlayableChanged;
            }
            else
            {
                VungleAdInstanceOnOnAdPlayableChanged(null, null);
            }
        }
コード例 #12
0
    // Starts up the SDK with the given appId
    private void Initialize(string appId)
    {
        VungleSDKConfig config = new VungleSDKConfig();

        if (Vungle.minimumDiskSpaceForInitialization.HasValue)
        {
            config.SetMinimumDiskSpaceForInit(Vungle.minimumDiskSpaceForInitialization.Value);
        }
        if (Vungle.minimumDiskSpaceForAd.HasValue)
        {
            config.SetMinimumDiskSpaceForAd(Vungle.minimumDiskSpaceForAd.Value);
        }
        if (Vungle.enableHardwareIdPrivacy.HasValue)
        {
            config.SetDisableAshwidTracking(Vungle.enableHardwareIdPrivacy.Value);
        }
        config.SetPluginName("unity");
        config.SetPluginVersion(Vungle.PluginVersion);
        config.SetApiEndpoint(new Uri(endpoint));
        sdk = AdFactory.GetInstance(appId, config);
        sdk.AddOnEvent(VungleManager.OnEvent);
        VungleSceneLoom.Initialize();
    }
コード例 #13
0
 public void initializeSDK()
 {
     vungleProvider = AdFactory.GetInstance(appID); // From a core integration
     inmobiProvider = AdFactory.GetInstance(appID); // Simulate the handler that InMobi will reflect and attach itself to
 }
コード例 #14
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
#if WIN10
            if (sdkInstance == null && GameGlobal.IsShowVideoAds && IsConnectedToInternet())
            {
                //sdkInstance = AdFactory.GetInstance("vungleTest");
                sdkInstance = AdFactory.GetInstance("565f4a8bd0ed15880f00004c");
                sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
            }
            else
            {
                progressRing.IsActive = false;
            }
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
            }

            progressRing.IsActive = false;
            var timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(7);
            timer.Tick += delegate
            {
                if (progressRing.IsActive && GameGlobal.IsShowVideoAds)
                {
                    progressRing.IsActive = false;
                    timer.Stop();
                }
            };
            timer.Start();

            Frame rootFrame = Window.Current.Content as Frame;
            string myPages = "";
            foreach (PageStackEntry page in rootFrame.BackStack)
            {
                myPages += page.SourcePageType.ToString() + "\n";
            }
            if (rootFrame.CanGoBack)
            {
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                    AppViewBackButtonVisibility.Visible;
            }
            else
            {
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                    AppViewBackButtonVisibility.Collapsed;
            }
#endif

            //IsGallery = string.Empty;
            //string[] parameters = e.Parameter.ToString().Split(',');
            //string sCategory = parameters[0];
            //IsGallery = sCategory == "-1" ? parameters[1] : string.Empty;
            //mImages.Clear();
            //if (string.IsNullOrEmpty(IsGallery))
            //{
#if WIN10
            string[] dirs = DirectoryGetFiles("Masha");
            foreach (string dir in dirs)
            {
                mImages.Add(new ImageEntity { ImageSource = new BitmapImage(new Uri("ms-appx:///" + dir, UriKind.RelativeOrAbsolute)) });
            }
#endif
#if WIN8_1
            progressRing.IsActive = false;
            string category = "Masha";
            var dirs = DirectoryGetFiles(category);
            foreach (var dir in dirs)
            {
                mImages.Add(new ImageEntity { ImageSource = new BitmapImage(new Uri("ms-appx:///Res\\Image\\" + category + "\\" + dir.Name, UriKind.RelativeOrAbsolute)) });
            }
#endif
            //}
            //else
            //{
            //    mImages.Add(new ImageEntity { ImageSource = GameGlobal.PictrueSource });
            //}
        }