Skip to content

Native Ads API

liuluchao edited this page Jul 28, 2016 · 29 revisions

The main APIs for the Native Ad

###SDK Version APIs The APIs for SDK Version :

  • com.cmcm.adsdk.nativead.NativeAdManager

    Methodology Method Introduction
    NativeAdManager(Context context, String adUnitId) NativaAdManager construct function
    setNativeAdListener(INativeAdLoaderListener listener) set callback interface
    loadAd( ) concurrent load ads
    preloadAd( ) sequence load ads
    getAd( ) get ads(Please make sure that the loadAd() is called and return success before use getAd() )
  • com.cmcm.baseapi.ads.INativeAd

    Methodology Method Introduction
    getAdtitle() ad title
    getAdBody() ad description
    getAdIconUrl() ad icon url
    getAdCoverImageUrl() ad background picture Url
    getAdCallToAction() ad button text
    getAdStarRating() ad star score(can be null)
    getAdSocialContext() ad download amount or website(can be null)
      getExtPics() | three pics uri
    

    hasExpired() | check ad expired(true mean expired) isDownLoadApp() | check download type app (true: yes false: no null: no information setImpressionListener(ImpressionListener listener) | set callback after SDK ad impression report registerViewForInteraction(View view) | bundle ad view with ad itself(requested) unregisterView() | unbundling ad view with ad itself(requested)

  • com.cmcm.baseapi.ads.INativeAdLoaderListener

    Methodology Method Introduction
    onAdLoaded() ad request success
    adFailedToLoad(int error) ad request failure
    adClicked(INativeAd ad) ad click

Clone this wiki locally