Show interstitial video ads from AdDuplex and Vungle. Additional setup is required once you have built the Universal Windows Platform solution from Unity - see the setup section at the bottom of the page
- The Cancelled event will never be raised
C#using CI.WSANative.Advertising;
Initialises the specified ad network - this should be called once for each ad network you intend to use
C#WSANativeInterstitialAd.Initialise(WSAInterstitialAdType.Vungle, "AppId");
WSANativeInterstitialAd.AdReady is raised once an ad is ready to play
C#WSANativeInterstitialAd.RequestAd(WSAInterstitialAdType.Vungle, "AdUnit or placement id");
WSANativeInterstitialAd.Completed is raised if the ad plays to completion
WSANativeInterstitialAd.Cancelled is raised if the ad is closed early by the user
C#WSANativeInterstitialAd.ShowAd(WSAInterstitialAdType.Vungle, "AdUnit or placement id");
Listen to these events for info about the ads lifecycle
C#WSANativeInterstitialAd.AdReady
C#WSANativeInterstitialAd.Cancelled
C#WSANativeInterstitialAd.Completed
C#WSANativeInterstitialAd.ErrorOcurred
Perform the following steps in the uwp solution
- Open the solution and add a reference to the ad sdks you wish to use (AdDuplex SDK, Vungle SDK)
- Download this file aand add it to the project which has the same name as your game. Make sure it is in the same folder as MainPage.xaml.cpp
- Open the file you just added to the project and you'll see some #defines at the top with the names of ad networks. Replace the 0 with a 1 next to the ones you plan to use
- Open MainPage.xaml.cpp and add the following includes
C##define GENERATED_PROJECT 1
#include "WSAAdvertisingBridge.h"
#include "InterstitialAdManager.h"
- At the bottom of the MainPage.xaml.cpp constructor add the following line
C#InterstitialAdManager::Initialise();
- Open the apps manifest file and add the internet client capability