Class POBNativeAdResponse
-
- All Implemented Interfaces:
public class POBNativeAdResponseBase class for storing the nativeAd response after parsing. Mandatory fields are version of the iab nativeAd response &List of assets (for asset refer POBNativeAdResponseAsset). Selection of the asset to be displayed will be done by matching the id of the asset with the request's asset id not on the basis of the type provided in the response. The asset without an id or a non-integer id will be ignored. Also takes List of event trackers, which is recommended to use over js &imp trackers(for event trackers refer POBNativeAdResponseEventTracker). It also stores the link which will be triggered after the ad is clicked(for link refer POBNativeAdLinkResponse).
-
-
Field Summary
Fields Modifier and Type Field Description public final Stringversionpublic final Map<Integer, POBNativeAdResponseAsset>assetspublic final POBNativeAdLinkResponselinkpublic final List<String>impressionTrackerspublic final StringjsTrackerpublic final List<POBNativeAdResponseEventTracker>eventTrackerspublic final StringprivacyUrl
-
Constructor Summary
Constructors Constructor Description POBNativeAdResponse(String version, List<POBNativeAdResponseAsset> assets, POBNativeAdLinkResponse link, List<String> impressionTrackers, String jsTracker, List<POBNativeAdResponseEventTracker> eventTrackers, String privacyUrl)Creates the object for the POBNativeAdResponse
-
Method Summary
Modifier and Type Method Description StringgetVersion()Returns version of the native ad response Map<Integer, POBNativeAdResponseAsset>getAssets()Return the assets present in the native ad response POBNativeAdLinkResponsegetLink()Returns the link object which is used when the ad is clicked. List<String>getImpressionTrackers()Returns the list of impression trackers present in the native ad response. StringgetJsTracker()Returns javascript string present in the native ad response. List<POBNativeAdResponseEventTracker>getEventTrackers()Returns the list of event trackers which are fired at appropriate time of action. StringgetPrivacyUrl()Returns the privacy url POBNativeAdResponseAssetgetAsset(int assetId)Return the assets present in the native ad response for given asset id List<POBNativeAdResponseEventTracker>getEventTrackers(@NonNull() POBNativeEventType eventType, @NonNull() POBNativeEventTrackingMethod method)Method to get event trackers with event type and tracking method StringtoString()Converts the object to a readable string -
-
Constructor Detail
-
POBNativeAdResponse
POBNativeAdResponse(String version, List<POBNativeAdResponseAsset> assets, POBNativeAdLinkResponse link, List<String> impressionTrackers, String jsTracker, List<POBNativeAdResponseEventTracker> eventTrackers, String privacyUrl)
Creates the object for the POBNativeAdResponse- Parameters:
version- String version of the native ad (required)assets- List of POBNativeAdResponseAsset (required)link- POBNativeAdLinkResponseimpressionTrackers- List of String for impression trackingjsTracker- String for trackingeventTrackers- List of POBNativeAdResponseEventTrackerprivacyUrl- String
-
-
Method Detail
-
getVersion
@Nullable() String getVersion()
Returns version of the native ad response
- Returns:
String
-
getAssets
@NonNull() Map<Integer, POBNativeAdResponseAsset> getAssets()
Return the assets present in the native ad response
- Returns:
instance of Map if available
-
getLink
@Nullable() POBNativeAdLinkResponse getLink()
Returns the link object which is used when the ad is clicked.
- Returns:
-
getImpressionTrackers
@Nullable() List<String> getImpressionTrackers()
Returns the list of impression trackers present in the native ad response.
- Returns:
List of String
-
getJsTracker
@Nullable() String getJsTracker()
Returns javascript string present in the native ad response.
- Returns:
String
-
getEventTrackers
@Nullable() List<POBNativeAdResponseEventTracker> getEventTrackers()
Returns the list of event trackers which are fired at appropriate time of action.
- Returns:
List of POBNativeAdResponseEventTracker
-
getPrivacyUrl
@Nullable() String getPrivacyUrl()
Returns the privacy url
- Returns:
String
-
getAsset
@Nullable() POBNativeAdResponseAsset getAsset(int assetId)
Return the assets present in the native ad response for given asset id
- Returns:
instance of POBNativeAdResponseAsset if available
-
getEventTrackers
@Nullable() List<POBNativeAdResponseEventTracker> getEventTrackers(@NonNull() POBNativeEventType eventType, @NonNull() POBNativeEventTrackingMethod method)
Method to get event trackers with event type and tracking method
- Parameters:
eventType- native event typemethod- native event tracking method- Returns:
list of event trackers with given type and method
-
-
-
-