VMAX also supports video ads with incent provision. These are video ads which on view completion will provide some virtual currency to users.
Vmax SDK supports wallet management to maintain walletElements also known as currency name which stores respective currency amount or total reward amount. And provides provision of getting total virtual currency, spending virtual currency, awarding virtual currency.
Below snippet shows the example of requesting Vast MarkUp Ads
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
// Initialize the adview object with proper adspot id and ux type VMAXAdView adView = new VMAXAdView(); adView.AdspotId = "MY_ADSPOT_ID"; adView.UX= AdUX.Interstitial; //Initialize wallet object Wallet wallet = Wallet.GetWallet(); //Create a wallet element WalletElement element = wallet.AddWalletElement("SampleWalletPath", "CurrencyName"); //Rewarded Video RewardedVideo rv = new RewardedVideo(element); // Set the following flags of the rewarded video to true or false as per your need to // show different popups rv.showCappingPopup = true; rv.showInterruptedPopup = true; rv.showPrePopup = true; rv.showPostPopup = true; // Set the texts for pre, post, interrupted and capping popups texts rv.PrePopupText = "Watch this video and get <reward> <currency>"; rv.PrePopupTitle = "VMAX"; rv.PostPopupText = "You earned <reward> <currency>"; rv.PostPopupTitle = "VMAX"; rv.InterruptedPopupText = "You will lose your reward"; rv.InterruptedPopupTitle = "VMAX"; rv.CappingPopupText = "Daily maximum count to view the ad reached"; rv.CappingPopupTitle = "VMAX"; // Set the necessary event handlers element.OnUpdateFailedVirtualCurrency += Element_OnUpdateFailedVirtualCurrency; element.OnUpdateVirtualCurrency += Element_OnUpdateVirtualCurrency; rv.OnRewardedVideoCompleted += Rv_OnRewardedVideoCompleted; rv.OnRewardedVideoInterrupted += Rv_OnRewardedVideoInterrupted; rv.OnRewardedVideoPlaybackError += Rv_OnRewardedVideoPlaybackError; // This is the most important API you need to call once initialization has been done adView.InitRewardedVideo(rv); // Now you can call CacheAd() or LoadAd()according to your need. adView.LoadAd(); // If you need to award currency, use AwardVirtualCurrency API. It takes long value as // input parameter element.AwardVirtualCurrency(100); // If you need to spend the currency, use SpendVirtualCurrency API. It takes long // value as input parameter element.SpendVirtualCurrency(20); // To get the currency for an WalletElement use GetVirtualCurrency element.GetVirtualCurrency(); |