Native ads are different from standard ad units in that rather than being a single, self-contained entity from the perspective of a publisher, they are a collection of individual components that can be laid out and interacted with individually, so the publisher can control the user experience of each element of the ad along with its layout. Upon retrieving a Native Ad, the SDK returns an object that contains information about the ad along with a list of components that represent the contents of the ad. The types of components are:
NativeTextComponent - This is a view that contains text.
NativeImageComponent - This is a view that contains an image.
NativeVideoComponent - This is a view that contains a video.
Different types of Native Ads may contain different components. In order to know the components that are available in an ad, the Ad Type can be requested using the following method:
At present, the only Native Ad Type supported by the Verizon Ads SDK is “inline” which has a defined set of components and component keys. As Verizon Media continues to innovate in the area of more engaging and high value ads, other ad types will become available. This is an important consideration when designing the integration of Verizon Ads SDK into an application. Below is a table that contains the components available for the “inline” Native Ad Type. The components that are Advertiser Required must be displayed in order to get credit for an ad impressions.
There is one method for accessing components. After accessing the component, it can be cast to its specific component type if desired.
To add a native add to an app, import the required headers, instantiate a NativeAdFactory, and load the ad. Once loaded, retrieve the components, get the associated view, and add the view to the app’s view hierarchy for display.
The NativeAdFactory callbacks communicate events related to ad loading. These are implemented as interfaces on Android and delegates on iOS. Please refer to the API documentation for Android and iOS for a complete list of available callbacks.
The Native ad callbacks provide the state of an ad that has been displayed. For example, callbacks signal user actions, errors, etc. Please refer to the API documentation for Android and iOS for a complete list of available callbacks.
Once an Ad has been loaded successfully, components can be retrieved for subsequent display. The number, type of components, and structure of these will vary based on the Native Ad Type that is returned. At present, the only supported Native Ad Type is “inline.” As Verizon Media and the industry expands more Native Ad Types will become available.
Once the ad components have been retrieved, styling can be applied, and they can be laid out within the app. In order to retrieve the actual view for a component, you must call getView (Android) or access the view property (iOS) prior to attaching the view.