Windows
Windows
Microsoft is proud to announce our partnership with Vungle, the leading in-app video ad platform . Vungle has released the Vungle SDK for Windows 10 apps, which powers monetization for apps across Windows 10 desktops, tablets, and phones.
About 35% of game developers currently use mobile video ads, and many find it a great source of revenue that can actually enhance UX. With this partnership, Microsoft now offers easy integration with one of the leading global monetization platforms for Windows developers.
If you’re ready to give in-app video ads a try, this guide will show you how to quickly integrate the Vungle SDK into your app so you can start earning revenue – in five easy steps. The are in C#, but we provide sample app files in C#, C++, Visual Basic, and DirectX+XAML.
A few notes before you get started…
See below for an example of an in-app video ad. For more information, visit vungle.com or [help page link for windows SDK).
About 35% of game developers currently use mobile video ads, and many find it a great source of revenue that can actually enhance UX. With this partnership, Microsoft now offers easy integration with one of the leading global monetization platforms for Windows developers.
If you’re ready to give in-app video ads a try, this guide will show you how to quickly integrate the Vungle SDK into your app so you can start earning revenue – in five easy steps. The are in C#, but we provide sample app files in C#, C++, Visual Basic, and DirectX+XAML.
A few notes before you get started…
- The integration requires a Vungle account, so if you don’t have one handy.
- If you haven’t already done so, head over to our and to your account. You need to do this so that you can get your App ID, which you’ll be adding to your app with our SDK. It’s in red on your app’s page.
- Download the SDK
from the Vungle Dashboard. Extract the archive once it’s finished downloading. - Add VungleSDK to your project
- In Visual Studio 2015, create a new project using the template appropriate for your application and programming language.
- Add a reference for your project to the Vungle Windows SDK file you downloaded.
- Make sure that your project has the “internetClient” capability in the package.appxmanifest file, as shown:
<Capabilities>
...
<Capability Name="internetClient" />
...
</Capabilities> - Import the VungleSDK namespace. For example:
using VungleSDK;
- Obtain a VungleAd instance
For example:
VungleAd sdkInstance;
// additional code if you need
sdkInstance = AdFactory.GetInstance("yourAppId"
In the above example, replace yourAppId with your app id that you got when you added your app to your account. - Create and register an event handler
Create event handler for OnAdPlayableChanged event. For example:
//Event handler for OnAdPlayableChanged event
private async void SdkInstance_OnAdPlayableChanged(object sender, AdPlayableEventArgs e)
{
//Run asynchronously on the UI thread
await CoreApplication.MainView.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal,
new DispatchedHandler(() => myRadMethod()));
}
Register this event handler for OnAdPlayableChanged event. For example:
sdkInstance.OnAdPlayableChanged += SdkInstance_OnAdPlayableChanged;
Check out our to subscribe to play events. These can be used to unpause audio, resume gameplay, etc. - Play an ad with your desired options selected (learn how to set options in the ); for example:
private async void IncentivizedConfigButton_Click(object sender, RoutedEventArgs e)
{
await sdkInstance.PlayAdAsync(
new AdConfig { Incentivized = true , SoundEnabled = false});
}
See below for an example of an in-app video ad. For more information, visit vungle.com or [help page link for windows SDK).