Skip to content

Native Ads API

CMAdSDK edited this page May 30, 2016 · 29 revisions

The main APIs for the Native Ad

The SDK Base Version APIs of the Native Ad is a little different from the SDK Ext Version.

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

  • com.cmcm.adsdk.nativead.NativeAdManagerMini

    Methodology Method Introduction
    NativeAdManagerMini(Context context, String posid) NativaAdManagerMini 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)
    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

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

  • com.cmcm.adsdk.nativead.NativeAdManagerEx

    Methodology Method Introduction
    NativeAdManagerEx(Context context, String posid) NativaAdManagerEx construct function
    setNativeAdListener(INativeAdLoaderListener listener) set callback interface
    loadAd( ) concurrent load ads
    preloadAd( ) sequence load ads
    getAd( ) get ads
  • 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)
    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