NativeAd Class

Definition

Important

The NativeAd class is deprecated. Use NativeAdV2 instead.

Represents a native ad, which is an ad format where all the components of the ad (including the title, image, description, and call to action text) are delivered to your app as separate elements. Use the properties of the NativeAd class to get each element of the native ad. You can integrate these elements into your app using your own choice of fonts, colors, and animations to build an ad experience that fits the look and feel of your app.

public ref class NativeAd sealed : IClosable
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.STA)]
/// [Windows.Foundation.Metadata.Version(1)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class NativeAd final : IClosable
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.STA)]
[Windows.Foundation.Metadata.Version(1)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class NativeAd : System.IDisposable
Public NotInheritable Class NativeAd
Implements IDisposable
Inheritance
Object Platform::Object IInspectable NativeAd
Attributes
Implements

Additional features and requirements

Software Development Kit
Minimum supported OS
Windows 10 (10.0.10240.0)

Properties

AdditionalAssets

Gets a dictionary of key/value pairs that contain data for additional optional asset types (if present) for the native ad that do not have corresponding properties in the NativeAd class. For example, key values can include desc2, displayurl, phone, address, likes, or downloads, as data asset types that are described in the OpenRTB Native Ads API Specification.

AdIcon

Gets the ad icon supplied by Microsoft. This icon is intended to be shown in your native ad experience to help differentiate the ad from the rest of your app.

CallToAction

Gets the call to action text for the native ad.

Description

Gets the description for the native ad.

IconImage

Gets the icon image for the native ad, as supplied by the ad sponsor.

MainImages

Gets the main images for the native ad, as supplied by the ad sponsor.

Price

Gets the price of the product that is being advertised in the native ad, including a currency symbol.

Rating

Gets the rating of the product that is being advertised in the native ad.

SponsoredBy

Gets the brand name of the sponsor for the product that is being advertised in the native ad.

Title

Gets the title for the native ad.

Methods

Close()

Frees associated system resources used by the control.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

RegisterAdContainer(FrameworkElement, IVector<FrameworkElement>)

Registers the UI element in your app that acts as a container for the native ad elements and any specific UI elements that can be clicked by the user. You must register these components to properly track ad impressions and clicks.

RegisterAdContainer(FrameworkElement)

Registers the specified UI element in your app that acts as a container for the native ad elements. When you use this method, the entire container is a clickable element for the ad. You must register the container to properly track ad impressions and clicks.

Applies to

See also