• English
  • Hindi
  • Bahasa
  • Vietnemese
  • Malay
  • Thai
Show Sidebar

Requesting Native Ads – Windows Phone 8 SDK

Rất tiếc, mục này chỉ tồn tại ở English.

The library internally provides two controls which can be added to the xaml file: InfeedControl and ContentStreamConrtol. You may even create an object of these control in the backend and add it to any one of your grids programmatically. This is how the library can be referred in the xaml

and this is how the controls can be referred to.

For code behind access, add the namespace after referring the dll in the project as:

Once the controls have been placed in the xaml, what remains is the actual native ad data to be shown in these controls. You can get the native ad data using the VMAX Windows phone sdk by selecting appropriate Ad UX Types and using proper Adspot Ids. You should, then, call an API SetContentAndShowNativeAd() on the controls. This API takes JObject (JSON object) as a parameter. (If you do not have a reference to the Newtonsoft.Json library, add it using the nuget package manager.) This JObject, you can obtain from the NativeAd property of the adView. The GetContent() API will return you a JObject from the native ad as shown here.

Once you call this API with its necessary parameter, the control will be populated with the necessary parameters from the JObject that was provided.

Here is a sample image showing the appearance of the ads:



In-feed ad



Content stream ad

Requesting Native Ads

Native ads are ads which you can customize to match the unique user experience of your app.
Native ads can be requested in the following manner –

See Additional Options for optional callbacks related to Native Ads.

If you wish to customize the controls in their appearance, the following is the list of attributes which you can change:


Properties Can developer modify
Background Color yes
Foreground Color yes
Border Thickness yes
Border Brush yes
Font Family yes
Font Style yes
Font Weight no
Font Stretch yes
Margin no (Changes in this attribute may distort the control)
Width no (Changes in this attribute may distort the control)
Height no (Changes in this attribute may distort the control)
Horizontal Alignment yes
Vertical Alignment yes
Changes in Phone Theme Color yes

The stars in the rating control take up the color of the theme applied.

What would you like to do next?