How to Set Up Rewarded Video (Virtual Currency)

Please Note:

  • Only available for aerWall (Rewarded) Ad Placements
  • Only applies to Video Ads


Step 1: Create an Ad Placement

To set up an Ad Placement, you will first need to create an App. For detailed instructions on how to create an App, please click here.

  1. Go to the "Inventory" tab in the nav bar and press the "+" icon next to the app you want to add an Ad Placement to.

  2. Specify the Ad Product that will be delivered to this new Ad Placement. For each ad product selected, a separate placement will be created. 


Step 2: Select the aerWall (Rewarded) Ad Product
  1. Enter a Name for this Ad Placement. This will be used throughout the platform to reference this Ad Placement.
  2. Select whether you would like the video ad to be Skippable or not.
  3. Set a Frequency Cap for the video ad.
  4. Enter the Currency Name. This is the name that will be returned on the VC completed event callback.
  5. Select Callback: Client or Client + Server.
  6. Enter the Reward Amount per completed view. This is the amount that will be returned on the VC completed event callback.
  7. When you are done, click on Next!


Step 3: Integrating Virtual Currency Events


For the iOS AerServ SDK, Virtual Currency information will be passed through the ASInterstitialViewControllerDelegate protocol. The parent view controller will conform to this protocol. When creating your ASInterstitialViewController object, be sure to set the delegate to the parent view controller.


Inside the parent view controller, define these two methods:

- (void)interstitialViewControllerDidVirtualCurrencyLoad:(ASInterstitialViewController *)viewController vcData:(NSDictionary *)vcData;

- (void)interstitialViewControllerDidVirtualCurrencyReward:(ASInterstitialViewController *)viewController vcData:(NSDictionary *)vcData;

From these two callback methods, all pertinent Virtual Currency information will be received. Please check the ASInterstitialViewController’s header file to see more information about the dictionary’s contents.



Android SDK

For the Android AerServ SDK, Virtual Currency information will be passed through the VC_READY (fires before a VC enabled Ad plays) and VC_REWARDED (fires after a VC enabled Ad has completed) Events through the Event Listener you have configured. Cast the first object of the args parameter to an AerServVirtualCurrency object and use .getName() and .getAmount() to get the VC Name and Amount configured for that Ad Placement. 


See example below:

AerServEventListener listener = new AerServEventListener(){
public void onAerServEvent(AerServEvent event, List args){
        switch (event) {
            case VC_REWARDED:
                AerServVirtualCurrency vc = (AerServVirtualCurrency) args.get(0);
                // do something here with your virtual currency!
                log.d("AerServVirtualCurrency", "VC rewarded: " + vc.getAmount() + " " + vc.getName());

AerServConfig config = new AerServConfig(this, "1003694").setEventListener(listener);
new AerServInterstitial(config).show();




Unity SDK

In order to enable Virtual Currency callbacks for Unity, the following two Events are required to be added to the Unity Project:

 /** Event Callback**/
        [MonoPInvokeCallback (typeof (OnAerServEvent))]
        static void aerServEventCallBack(int eventType, String args) {

            String[] argsArr = (args != null) ? args.Split('|') : null;

            switch(eventType) {
                case SDK.VC_READY:
                    message += del + "VC_READY invoked! Name: " + argsArr[0] + " Amount: " + argsArr[1];
                case SDK.VC_REWARDED:
                    message += del + "VC_REWARDED invoked! Name: " + argsArr[0] + " Amount: " + argsArr[1];

Step 4: Test Virtual Currency with Test Ad Placements (OPTIONAL)
To test VC, go to the placement edit page and set your rewarded plc to "test" mode and enter your VC information. This will allow test ads to run through your placement to help verify your integration. When you are done with the verification process, please remember to uncheck the "test mode" checkbox to begin receiving live ads.  

Summary of SDK mediation networks that support Virtual Currency events:

Interstitial Yes
Interstitial Yes
Interstitial Yes
Interstitial Yes
Interstitial Yes




Step 5: Virtual Currency with Server Side (OPTIONAL)

  1. Select Client + Serverside Callback 
  2. Enter a Callback URL
  3. Use the Secret Key to create a HMAC for additional security

Passing in user id is a required method needed for frequency capping by request. 

SDK setup

IOS Method Call:  

@property (nonatomic, strong) NSString *userId; 

Android Method Call: 


//Code Example// AerServConfig Config = new AerServConfig(this, "1000741");

Unity Method Call: 


//code Example//
Dictionary<string, object> config = new Dictionary<string,
object>(); config.Add(SDK.PARAM_USER_ID, "AerServ Test User");
config.Add(SDK.PARAM_TIMEOUT_MILLIS, 10000);
SDK.LoadInterstitial(plc, aerServEventCallBack, config);

Minimum Sample Callback url:$[vc_user_id]&amount=$[vc_award_amount]&currency=$[vc_name]


Full Sample Callback url:$[vc_user_id]&amount=$[vc_award_amount]&currency=$[vc_name]&rid=$[rid]&hmac=$[hmac] 


Example URL Response codes:


Example url callback:

In this site:

Enter following to Encrypt and look for results for Sha1 (rid+currency+amount+user+secretkey):
64c30cf4-4fd8-4246-a6b4-664a7e4601a0+vc test+500.0+testandroid+2712335A84C11


VC Currency Macro
Virtual Currency ID $[vc_user_id] Yes Yes Verify User ID
Virtual Currency Amount $[vc_award_amount] Yes Yes Verify Currency Amount
Virtual Currency Name $[vc_name] No Yes Verify Currency Name
Virtual Currency RID $[rid] No Yes Verifying unique RID (REQUEST ID) for duplicate layer of additional layer of security and validation
Virtual Currency HMAC $[hmac] No Yes Verify All macro including secret key 




Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request