VMAX
 
 
 
 
Show Sidebar

Additional Options – Windows Phone 8 SDK

Rất tiếc, mục này chỉ tồn tại ở English. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

Optional Callbacks

The VMAXAdView generates callbacks for successful and unsuccessful fetching attempts of Ads.

Methods

Specifying callbacks in XAML

Specifying callbacks through Code

The following methods are used to generate API callbacks.

FailedToLoadAd Callback

The VMAX SDK offers this callback, in cases where an Ad is not served. If required, this event can be used to run any custom code.

FailedToCacheAd Callback

The VMAX SDK offers this callback, in cases where an Ad is not cached. If required, this event can be used to run any custom code.

DidLoadAd Callback

The VMAX SDK offers this callback, in cases where an Ad is rendered successfully. If required, this event can be used to run any custom code.

DidCacheAd Callback

The VMAX SDK offers this callback, in cases where an Ad is cached successfully. If required, this event can be used to run any custom code.

DidInteractWithAd Callback

The VMAX SDK offers this callback, in cases when you interact with an interstitial/overlay. If required, this event can be used to run any custom code.

WillDismissOverlay Callback

The VMAX SDK offers this callback, in cases of an Ad dismissal. If required, this event can be used to run any custom code.

WillLeaveApp Callback

The VMAX SDK offers this callback, in cases of the Ad closing the current App and opening another App. If required, this event can be used to run any custom code.

WillPresentOverlay Callback

The VMAX SDK offers this callback, in cases where an interstitial/overlay is shown. If required, this event can be used to run any custom code.

DidRenderNativeAd()

This callback can notify you about the successful rendering of the native ad.

FailedToRenderNativeAd()

You can register for an event FailedToRenderNativeAdwhich can tell you the reason behind the failure in rendering the native ad. One of the reasons can be Empty or Improper JObject being passed to the SetContentAndShowNativeAd() API.

The class NativeAdEventArgs contains a field by name ErrorMessage which can tell you the exact reason for the failure in rendering the native ad.

JSON Details

The VMAX Server gives you a JSON that will appear as below:

It has several fields out which help in rendering the native ad depending upon the type. The VMAX Sdk also internally gets the same JSON. But it adds more elements to it and creates a new JSON like:

You can pass any of the above mentioned forms of JSON objects (in a JObject format) to the SetContentAndRenderNativeAd() API and the ad will be rendered according to the type of control used (Infeed or Content Stream).

What would you like to do next?