Share via


NativeAdV2 Class

Definition

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 NativeAdV2 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. For a walkthrough that demonstrates how to use the NativeAdV2 class in your app, including code examples, see Native ads.

public ref class NativeAdV2 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 NativeAdV2 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 NativeAdV2 : System.IDisposable
Public NotInheritable Class NativeAdV2
Implements IDisposable
Inheritance
Object Platform::Object IInspectable NativeAdV2
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 NativeAdV2 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.

CallToActionText

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.

PrivacyUrl

Gets the privacy URL from the ad provider.

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.

Events

AdClicked

Raised when the user clicks the native ad container.

Applies to

See also