Class POBNativeAdParser

  • All Implemented Interfaces:

    
    public class POBNativeAdParser
    
                        

    Parser class that handles parsing of the json response.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      POBNativeAdResponse parseNativeAdResponse(@NonNull() String nativeAdContent) Parses the native ad response.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • POBNativeAdParser

        POBNativeAdParser()
    • Method Detail

      • parseNativeAdResponse

        @Nullable() POBNativeAdResponse parseNativeAdResponse(@NonNull() String nativeAdContent)

        Parses the native ad response. Function return POBNativeAdResponse in case of successful parsing of the json response. Return "null" in case of json response is not formatted or the assets array is empty.

        Parameters:
        nativeAdContent - native ad response String
        Returns:

        POBNativeAdResponse { <-- response "ver" : ..., <-- nativeAdVersion "assets" : [ <-- nativeAdAssetsArray { "id": 1, "required": 1, "title": { <--- titleAssetObject "text": "...", "len": 1 }, "link": {...} }, { "id": 2, "required": 1, "img": { <-- imageAssetObject "url": "...", "w": 1, "h": 1, "type": 1 }, "link": {...} }, { "id": 3, "required": 1, "data": { <-- dataAssetObject "value": "...", "len": 1, "type": 1 }, "link": {...} }], "link" : { <-- nativeAdLinkObject "url": "...", "clicktrackers": ["...","..."], "fallback": "..." }, "imptrackers": ["..."], <-- nativeAdImpressionTrackersObject "jstracker" : "...", "eventtrackers" : [{ <-- nativeAdEventTrackersObject "event": 1, "method": 1, "url": "..." }], "privacy": "...", <-- privacyUrl }